Conversation

akansehl

No description provided.

@pytorch-botPyTorch Bot

🔗 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.

@facebook-github-bot

Hi @akansehl!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

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")

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

@@ -590,8 +592,9 @@ def test_different_configs_error(self):
a @ b

@unittest.skipIf(
not torch.hpu.is_available() and

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

@@ -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")

Choose a reason for hiding this comment

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

torch.finfo = wrap_torch_finfo


def supported_device_available():

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

@akansehlakansehl marked this pull request as draft June 12, 2025 08:35
@akansehlakansehl changed the title DUMMY PR: add support for hpu in float8 base and compile test for torch ao WIP PR: add support for hpu in float8 base and compile test for torch ao Jun 12, 2025
Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.