-
-
Notifications
You must be signed in to change notification settings - Fork 15.7k
[CI] Use float16 for test_bad_words to ensure compatibility with XPUs
#27089
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
|
|
||
| @pytest.fixture(scope="module") | ||
| def llm() -> LLM: | ||
| return LLM(MODEL, enforce_eager=True) | ||
| return LLM(MODEL, enforce_eager=True, dtype="half") | ||
|
Comment on lines
12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The fixture now constructs the shared Useful? React with 👍 / 👎. |
||
|
|
||
|
|
||
| def test_n_gt_1(llm): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change to
dtype="half"affects all 10 tests in this file since they share thellmfixture. While this fixestest_bad_wordson XPU, applying a precision-reducing change this broadly is risky. It could introduce subtle, hard-to-debug numerical issues in other tests now or in the future, especially on different hardware.For better maintainability and to prevent unintended side effects, it's safer to isolate this change. I recommend creating a new fixture with
dtype="half"and using it only fortest_bad_words.For example:
This would require updating
test_bad_wordsto use the new fixture, but it makes the change's scope and purpose explicit and avoids impacting other tests.