Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Fix CI for deprecated attention block when used with device_map #9442

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
10 changes: 9 additions & 1 deletion .github/workflows/push_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ jobs:
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
# DeprecatedAttentionBlockTests::test_conversion_when_using_device_map fails
Copy link
Collaborator

@yiyixuxu yiyixuxu Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know why this test would fail with -n 1 --dist=loadfile option? also did you tested it anywhere that it would work without this option?

I tried both

pytest -n 1 --dist=loadfile tests/models/test_attention_processor.py::DeprecatedAttentionBlockTests::test_conversion_when_using_device_map

and

pytest tests/models/test_attention_processor.py::DeprecatedAttentionBlockTests::test_conversion_when_using_device_map

both were passing on my machine; but I can see it failed on CI so just wondering

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah same. I tested on DGX and audace and both passed. So, no idea. Didn’t dig deeper because the blocks are deprecated anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the test would pass if we remove this line "-n 1 --dist=loadfile" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On our CI, yes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok! I'm ok with the change then
what do you think @DN6 ?

# without this. `DeprecatedAttentionBlockTests` aren't used anyway, so this should
# be okay.
if [[ "${{ matrix.module }}" != "models" ]]; then
PYTEST_ARGS="-n 1 --dist=loadfile"
else
PYTEST_ARGS=""
fi
python -m pytest $PYTEST_ARGS --max-worker-restart=0 \
-s -v -k "not Flax and not Onnx" \
--make-reports=tests_torch_cuda_${{ matrix.module }} \
tests/${{ matrix.module }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release_tests_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ jobs:
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
# DeprecatedAttentionBlockTests::test_conversion_when_using_device_map fails
# without this. `DeprecatedAttentionBlockTests` aren't used anyway, so this should
# be okay.
if [[ "${{ matrix.module }}" != "models" ]]; then
PYTEST_ARGS="-n 1 --dist=loadfile"
else
PYTEST_ARGS=""
fi
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-s -v -k "not Flax and not Onnx" \
--make-reports=tests_torch_${{ matrix.module }}_cuda \
Expand Down
Loading