-
Notifications
You must be signed in to change notification settings - Fork 75
[rocm7.0_internal_testing]fp8: optimize skip rowwise tests #2476
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -46,7 +46,7 @@ | |||||
| parametrize, | ||||||
| run_tests, | ||||||
| skipIfRocm, | ||||||
| skipIfRocmArch, | ||||||
| skipIfRocmVersionAndArch, | ||||||
| skipIfRocmVersionLessThan, | ||||||
| TEST_CUDA, | ||||||
| TEST_WITH_ROCM, | ||||||
|
|
@@ -908,7 +908,7 @@ def test_float8_scale_fast_accum(self, device) -> None: | |||||
| out_fp8_s = torch._scaled_mm(x, y, scale_a=scale_a, scale_b=scale_b, use_fast_accum=True) | ||||||
| self.assertEqual(out_fp8, out_fp8_s) | ||||||
|
|
||||||
| @skipIfRocmArch("gfx950") | ||||||
| @skipIfRocmVersionAndArch((7, 1), "gfx950") | ||||||
| @unittest.skipIf(not PLATFORM_SUPPORTS_FP8 or IS_WINDOWS, f8_msg) | ||||||
| @unittest.skipIf(not SM89OrLater, "rowwise implementation is currently sm89+ specific") | ||||||
| @parametrize("use_fast_accum", [True, False]) | ||||||
|
|
@@ -1014,7 +1014,7 @@ def test_float8_error_messages(self, device) -> None: | |||||
| out_dtype=torch.bfloat16, | ||||||
| ) | ||||||
|
|
||||||
| @skipIfRocmArch("gfx950") | ||||||
| @skipIfRocmVersionAndArch((7, 1), "gfx950") | ||||||
|
||||||
| @skipIfRocmVersionAndArch((7, 1), "gfx950") | |
| @skipIfRocmVersionAndArch((7, 1), ["gfx950"]) |
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.
"in" operator can also used for string comparison !
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1987,6 +1987,23 @@ def wrap_fn(self, *args, **kwargs): | |||||
| return wrap_fn | ||||||
| return dec_fn | ||||||
|
|
||||||
| def skipIfRocmVersionAndArch(version=None, arch=None): | ||||||
| def dec_fn(fn): | ||||||
| @wraps(fn) | ||||||
| def wrap_fn(self, *args, **kwargs): | ||||||
| if TEST_WITH_ROCM: | ||||||
| rocm_version = str(torch.version.hip) | ||||||
| rocm_version = rocm_version.split("-")[0] # ignore git sha | ||||||
| rocm_version_tuple = tuple(int(x) for x in rocm_version.split(".")) | ||||||
| if rocm_version_tuple is None or version is None or rocm_version_tuple < tuple(version): | ||||||
|
||||||
| if rocm_version_tuple is None or version is None or rocm_version_tuple < tuple(version): | |
| if version is None or rocm_version_tuple < tuple(version): |
Copilot
AI
Aug 7, 2025
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 will raise an exception if arch is None, but the function parameter allows None values. Add a null check: if arch and prop.gcnArchName.split(":")[0] in arch:
| if prop.gcnArchName.split(":")[0] in arch: | |
| if arch and prop.gcnArchName.split(":")[0] in arch: |
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.
The new decorator expects an iterable for the arch parameter (based on the
inoperator usage), but a string is passed. This should be a list:@skipIfRocmVersionAndArch((7, 1), ["gfx950"])