Skip to content

Commit 04d01af

Browse files
fix: update fms-accel to release version
Signed-off-by: yashasvi <[email protected]>
1 parent ec0767c commit 04d01af

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ flash-attn = ["flash-attn>=2.8.3"]
4848
aim = ["aim>=3.19.0,<4.0"]
4949
mlflow = ["mlflow"]
5050
clearml = ["clearml==2.0.0"]
51-
fms-accel = ["fms-acceleration @ git+https://github.com/foundation-model-stack/fms-acceleration.git#subdirectory=plugins/framework"]
51+
fms-accel = ["fms-acceleration>=0.6.2"]
5252
gptq-dev = ["auto_gptq>0.4.2", "optimum>=1.15.0"]
5353
mamba = ["mamba_ssm[causal-conv1d]>=2.0.0,<3.0.0"]
5454
scanner-dev = ["HFResourceScanner>=0.1.0"]

tests/acceleration/test_acceleration_framework.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,10 @@ def test_framework_raises_if_used_with_missing_package():
293293

294294

295295
@pytest.mark.skipif(
296-
not is_fms_accelerate_available(plugins="peft"),
297-
reason="Only runs if fms-accelerate is installed along with accelerated-peft plugin",
296+
(not is_fms_accelerate_available(plugins="peft"))
297+
or (not torch.cuda.is_available()),
298+
reason="Only runs if fms-accelerate is installed along with accelerated-peft plugin\
299+
and GPU is available",
298300
)
299301
@pytest.mark.parametrize(
300302
"bad_kwargs,peft_config,exception,exception_msg",
@@ -359,7 +361,9 @@ def test_framework_raises_due_to_invalid_arguments(
359361

360362
@pytest.mark.skipif(
361363
not is_fms_accelerate_available(plugins="peft"),
362-
reason="Only runs if fms-accelerate is installed along with accelerated-peft plugin",
364+
or (not torch.cuda.is_available()),
365+
reason="Only runs if fms-accelerate is installed along with accelerated-peft plugin\
366+
and if GPU is available",
363367
)
364368
@pytest.mark.parametrize(
365369
"quantized_lora_config,model_name_or_path,mock_and_spy",
@@ -412,10 +416,11 @@ def test_framework_initialized_properly_peft(
412416

413417

414418
@pytest.mark.skipif(
415-
not is_fms_accelerate_available(plugins=["peft", "foak"]),
419+
(not is_fms_accelerate_available(plugins=["peft", "foak"]))
420+
or (not torch.cuda.is_available()),
416421
reason=(
417-
"Only runs if fms-accelerate is installed along with accelerated-peft "
418-
"and foak plugins"
422+
"Only runs if fms-accelerate is installed along with accelerated-peft\
423+
and foak plugins, run if GPU is available"
419424
),
420425
)
421426
def test_framework_initialized_properly_foak():
@@ -484,8 +489,9 @@ def test_framework_initialized_properly_foak():
484489

485490

486491
@pytest.mark.skipif(
487-
not is_fms_accelerate_available(plugins="moe"),
488-
reason="Only runs if fms-accelerate is installed along with accelerated-moe plugin",
492+
(not is_fms_accelerate_available(plugins="moe")) or (not torch.cuda.is_available()),
493+
reason="Only runs if fms-accelerate is installed along with accelerated-moe plugin \
494+
and GPU is available",
489495
)
490496
def test_framework_initialized_properly_moe():
491497
"""Ensure that specifying a properly configured acceleration dataclass
@@ -538,9 +544,10 @@ def test_framework_initialized_properly_moe():
538544

539545

540546
@pytest.mark.skipif(
541-
not is_fms_accelerate_available(plugins="aadp"),
547+
(not is_fms_accelerate_available(plugins="aadp"))
548+
or (not torch.cuda.is_available()),
542549
reason="Only runs if fms-accelerate is installed along with \
543-
attention_and_distributed_packing plugin",
550+
attention_and_distributed_packing plugin and GPU is available",
544551
)
545552
def test_framework_initialize_and_trains_with_aadp():
546553
"""
@@ -813,9 +820,10 @@ def test_error_raised_fast_moe_with_non_moe_model():
813820

814821

815822
@pytest.mark.skipif(
816-
not is_fms_accelerate_available(plugins="foak"),
823+
(not is_fms_accelerate_available(plugins="foak"))
824+
or (not torch.cuda.is_available()),
817825
reason="Only runs if fms-accelerate is installed along with \
818-
fused_ops_and_kernels plugin",
826+
fused_ops_and_kernels plugin and GPU is available",
819827
)
820828
def test_fastkernels_with_full_finetuning_runs_successfully():
821829
"""

tox.ini

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ envlist = py, lint, fmt
55
description = run unit tests
66
deps =
77
pytest>=7
8-
.[aim,mlflow,clearml,scanner-dev]
8+
.[aim,mlflow,clearml,scanner-dev,fms-accel]
9+
commands_pre =
10+
python -m fms_acceleration.cli install fms_acceleration_peft
11+
python -m fms_acceleration.cli install fms_acceleration_foak
12+
python -m fms_acceleration.cli install fms_acceleration_aadp
13+
python -m fms_acceleration.cli install fms_acceleration_moe
914
commands =
1015
pytest {posargs:tests}
1116

1217
[testenv:fmt]
1318
description = format with pre-commit
1419
deps =
1520
pre-commit
21+
.[fms-accel]
1622
commands = ./scripts/fmt.sh
1723
allowlist_externals = ./scripts/fmt.sh
1824

@@ -21,7 +27,7 @@ description = lint with pylint
2127
deps =
2228
pylint>=2.16.2,<=3.1.0
2329
pytest
24-
.[dev]
30+
.[dev,fms-accel]
2531
commands = pylint tuning scripts/*.py build/*.py tests
2632
allowlist_externals = pylint
2733

@@ -44,6 +50,7 @@ description = report unit test coverage
4450
deps =
4551
coverage
4652
pytest
53+
.[fms-accel]
4754
genbadge[coverage]
4855
commands =
4956
coverage run \

0 commit comments

Comments
 (0)