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
jerrrrry
infinilm
Commits
5dc85bf4
"vscode:/vscode.git/clone" did not exist on "9b23e3cc7677643f6adaf6c327275d0a7cdff02c"
Commit
5dc85bf4
authored
Mar 06, 2026
by
wooway777
Browse files
issue/248 - change default attn backend to classic impl
parent
84fbe5b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
README.md
README.md
+1
-1
examples/bench.py
examples/bench.py
+2
-2
examples/jiuge.py
examples/jiuge.py
+2
-2
python/infinilm/infer_engine.py
python/infinilm/infer_engine.py
+1
-1
No files found.
README.md
View file @
5dc85bf4
...
...
@@ -176,5 +176,5 @@ python scripts/test_ppl.py --model-path MODEL_PATH [--ndev NDEV] [--max-batch MA
```
- 选择attention后端 (使用flash attention后端需要先在InfiniCore完成相关配置和编译)
```
bash
python examples/bench.py --nvidia --model=
<model-path>
--enable-paged-attn [--attn=
flash-attn | --attn=default
]
python examples/bench.py --nvidia --model=
<model-path>
--enable-paged-attn [--attn=
default | --attn=flash-attn
]
```
examples/bench.py
View file @
5dc85bf4
...
...
@@ -255,7 +255,7 @@ def get_args():
parser
.
add_argument
(
"--attn"
,
type
=
str
,
default
=
"
flash-attn
"
,
default
=
"
default
"
,
choices
=
[
"default"
,
"flash-attn"
],
help
=
"attention backend to use: 'default' or 'flash-attn'"
,
)
...
...
@@ -285,7 +285,7 @@ class TestModel:
skip_load
=
False
,
cache_config
=
None
,
enable_graph
=
False
,
attn_backend
=
"
flash-attn
"
,
attn_backend
=
"
default
"
,
)
->
None
:
model_path
=
os
.
path
.
expanduser
(
model_path
)
# ---------------------------------------------------------------------------- #
...
...
examples/jiuge.py
View file @
5dc85bf4
...
...
@@ -145,7 +145,7 @@ def get_args():
parser
.
add_argument
(
"--attn"
,
type
=
str
,
default
=
"
flash-attn
"
,
default
=
"
default
"
,
choices
=
[
"default"
,
"flash-attn"
],
help
=
"attention backend to use: 'default' or 'flash-attn'"
,
)
...
...
@@ -164,7 +164,7 @@ def test(
top_k
=
1
,
top_p
=
1.0
,
temperature
=
1.0
,
attn_backend
=
"
flash-attn
"
,
attn_backend
=
"
default
"
,
):
model_path
=
os
.
path
.
expanduser
(
model_path
)
# ---------------------------------------------------------------------------- #
...
...
python/infinilm/infer_engine.py
View file @
5dc85bf4
...
...
@@ -29,7 +29,7 @@ class InferEngine(_infinilm.InferEngine):
distributed_config
=
DistConfig
(
1
),
cache_config
=
None
,
enable_graph_compiling
=
False
,
attention_backend
=
"
flash-attn
"
,
attention_backend
=
"
default
"
,
):
self
.
config
=
AutoConfig
.
from_pretrained
(
model_path
)
...
...
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