Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
hg-misc-tools
Commits
d4a6af96
Commit
d4a6af96
authored
Apr 13, 2026
by
one
Browse files
[evo2] Update to dtk26.04
parent
00210658
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
21 deletions
+41
-21
projects/evo2/evo2_fix.patch
projects/evo2/evo2_fix.patch
+28
-18
projects/evo2/test_evo2_generation_batched.py
projects/evo2/test_evo2_generation_batched.py
+13
-3
No files found.
projects/evo2/evo2_fix.patch
View file @
d4a6af96
diff --git a/evo2/configs/evo2-7b-1m.yml b/evo2/configs/evo2-7b-1m.yml
index 5ee5461..4fc408f 100644
--- a/evo2/configs/evo2-7b-1m.yml
+++ b/evo2/configs/evo2-7b-1m.yml
@@ -49,7 +49,7 @@
mha_out_proj_bias: True
hyena_out_proj_bias: True
hyena_flip_x1x2: False
qkv_proj_bias: False
-use_fp8_input_projections: True
+use_fp8_input_projections: False
max_seqlen: 1048576
max_batch_size: 1
final_norm: True
diff --git a/evo2/test/test_evo2_generation.py b/evo2/test/test_evo2_generation.py
index
789ecb3..2345c75
100644
index
bc420b7..928854f
100644
--- a/evo2/test/test_evo2_generation.py
+++ b/evo2/test/test_evo2_generation.py
@@ -4,6 +4,7 @@
from importlib import resources
...
...
@@ -19,38 +32,35 @@ index 789ecb3..2345c75 100644
generated = model.generate(
prompt_seqs=[prompt],
n_tokens=n_tokens,
@@ -72,
7
+75,
10
@@
def generate_and_score(*, sequences, model, generations_per_prompt=5, n_tokens=5
@@ -72,
6
+75,
9
@@
def generate_and_score(*, sequences, model, generations_per_prompt=5, n_tokens=5
top_k=top_k,
top_p=top_p,
)
-
+ if torch.cuda.is_available(): torch.cuda.synchronize()
+ elapsed_time += time.perf_counter()
+ print(f"[{i}] Time for model.generate: {elapsed_time:.3f} s")
+
decoded_seq = generated.sequences[0] # Assuming generate returns list of sequences
score = calculate_sequence_identity(decoded_seq, target)
scores.append(score)
@@ -94,6 +100,7 @@
def main():
@@ -95,7 +101,7 @@
def main():
parser = argparse.ArgumentParser(description="Test Evo2 Model Generation")
parser.add_argument("--model_name", choices=['evo2_7b', 'evo2_40b', 'evo2_1b_base'], default='evo2_7b',
help="Model to test (supports evo2_7b, evo2_40b, evo2_1b_base)")
parser.add_argument("--model_name", choices=['evo2_7b', 'evo2_40b', 'evo2_1b_base', 'evo2_20b'], default='evo2_7b',
help="Model to test (supports evo2_7b, evo2_40b, evo2_1b_base, evo2_20b)")
-
+ parser.add_argument("--local_path", type=str, default=None)
args = parser.parse_args()
@@ -101,8 +108,8 @@
def main():
# Reduce CUDA memory fragmentation for large models (e.g. evo2_20b)
@@ -105,7 +111,7 @@
def main():
torch.manual_seed(1)
torch.cuda.manual_seed(1)
- model = Evo2(args.model_name)
-
+ model = Evo2(args.model_name, local_path=args.local_path)
+
# Test parameters: greedy sampling of 500 tokens
test_params = {
'n_tokens': 500,
@@ -140,4 +147,4 @@
def main():
@@ -145,4 +151,4 @@
def main():
print(f"\nTest Failed: Expected {expected_score}%, got {mean_score}%")
if __name__ == "__main__":
...
...
@@ -58,15 +68,15 @@ index 789ecb3..2345c75 100644
\
No newline at end of file
+ main()
diff --git a/pyproject.toml b/pyproject.toml
index
fb1c1e6..6c7bd64
100644
index
4347bbc..77b3f6f
100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -
3
,7 +
3
,7 @@
name = "evo2"
version = "0.
3.0
"
@@ -
7
,7 +
7
,7 @@
name = "evo2"
version = "0.
5.3
"
description = "Genome modeling across all domains of life"
readme = "README.md"
-requires-python = ">=3.11,<3.13"
+requires-python = ">=3.10,<3.13"
license =
"Apache-2.0"
license =
{file = "LICENSE"}
authors = [
{name = "Evo 2 Team"},
projects/evo2/test_evo2_generation_batched.py
View file @
d4a6af96
...
...
@@ -5,6 +5,7 @@ from pathlib import Path
from
typing
import
Optional
import
numpy
as
np
import
time
import
torch
from
evo2
import
Evo2
...
...
@@ -190,13 +191,14 @@ def main():
- Evo 2 40B 1m: 91.15%
- Evo 2 7B 1m: 89.25%
- Evo 2 1B base: 68.0%
- Evo 2 20B 1m: 93.4%
"""
parser
=
argparse
.
ArgumentParser
(
description
=
"Test Evo2 Model Generation"
)
parser
.
add_argument
(
"--model_name"
,
choices
=
[
"evo2_7b"
,
"evo2_40b"
,
"evo2_1b_base"
],
choices
=
[
"evo2_7b"
,
"evo2_40b"
,
"evo2_1b_base"
,
"evo2_20b"
],
default
=
"evo2_7b"
,
help
=
"Model to test (supports evo2_7b, evo2_40b, evo2_1b_base)"
,
help
=
"Model to test (supports evo2_7b, evo2_40b, evo2_1b_base
, evo2_20b
)"
,
)
parser
.
add_argument
(
"--local_path"
,
type
=
str
,
default
=
None
)
parser
.
add_argument
(
...
...
@@ -247,6 +249,9 @@ def main():
args
=
parser
.
parse_args
()
# Reduce CUDA memory fragmentation for large models (e.g. evo2_20b)
torch
.
cuda
.
memory
.
_set_allocator_settings
(
"expandable_segments:True"
)
# Set random seeds
torch
.
manual_seed
(
1
)
torch
.
cuda
.
manual_seed
(
1
)
...
...
@@ -303,7 +308,12 @@ def main():
# Validate against expected scores
eps
=
3
# large epsilon for direct comparison, since there are numeric differences by versions
expected_scores
=
{
"evo2_40b"
:
91.15
,
"evo2_7b"
:
89.25
,
"evo2_1b_base"
:
68.0
}
expected_scores
=
{
"evo2_40b"
:
91.15
,
"evo2_7b"
:
89.25
,
"evo2_1b_base"
:
68.0
,
"evo2_20b"
:
93.4
,
}
expected_score
=
expected_scores
[
args
.
model_name
]
if
abs
(
mean_score
-
expected_score
)
<
eps
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment