-
Notifications
You must be signed in to change notification settings - Fork 284
DUMMY PR: add support for hpu in float8 base and compile test for torch ao #2326
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2326
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @akansehl! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
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.
Have given some general comments , I think we can refine it further, for skips lets use the if not supported_device()
@@ -239,11 +240,11 @@ def test_axiswise_reshape(self): | |||
(ScalingGranularity.TENSORWISE, ScalingGranularity.AXISWISE), | |||
], | |||
) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not is_sm_at_least_90(), "Requires CUDA capability >= 9.0") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -272,7 +273,7 @@ def test_axiswise_gemm(self, a_shape, a_granularity, b_granularity): | |||
sqnr = compute_error(c_ref, c_fp8_compute) | |||
assert sqnr >= 25.0 | |||
|
|||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -337,7 +338,7 @@ def _test_linear_impl( | |||
@pytest.mark.parametrize("linear_dtype", [torch.bfloat16, torch.float32]) | |||
@pytest.mark.parametrize("linear_bias", [False, True]) | |||
@pytest.mark.parametrize("use_ac", [False, True]) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -379,23 +380,23 @@ def test_linear_from_config_params( | |||
) | |||
@pytest.mark.parametrize("x_shape", [(16, 16), (2, 16, 16), (3, 2, 16, 16)]) | |||
@pytest.mark.parametrize("linear_bias", [True, False]) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -409,32 +410,32 @@ def test_linear_from_recipe( | |||
@pytest.mark.parametrize( | |||
"linear_dtype", [torch.float16, torch.bfloat16, torch.float32] | |||
) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -590,8 +592,9 @@ def test_different_configs_error(self): | |||
a @ b | |||
|
|||
@unittest.skipIf( | |||
not torch.hpu.is_available() and |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -681,7 +684,7 @@ class TestNumerics: | |||
torch.float8_e5m2fnuz, | |||
], | |||
) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -88,7 +90,7 @@ def _test_compile_base( | |||
) | |||
@pytest.mark.parametrize("emulate", [False, True] if is_sm_at_least_89() else [True]) | |||
@pytest.mark.parametrize("dtype", [torch.bfloat16, torch.float32]) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
@@ -124,7 +126,7 @@ def test_eager_only( | |||
[ScalingType.DYNAMIC], | |||
) | |||
@pytest.mark.parametrize("dtype", [torch.bfloat16, torch.float32]) | |||
@unittest.skipIf(not torch.cuda.is_available(), "CUDA not available") | |||
@unittest.skipIf(not torch.hpu.is_available() and not torch.cuda.is_available(), "Accelerator not available") |
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.
can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
torch.finfo = wrap_torch_finfo | ||
|
||
|
||
def supported_device_available(): |
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.
for the skips you can use this as well, in conjunction to this can use the accelerator APIs directly : https://docs.pytorch.org/docs/stable/generated/torch.accelerator.is_available.html
eg:
supported accelerator:
if torch.accelerator.is_available() :
if hpu or cuda
No description provided.