pytorch - 💡(How to fix) Fix DISABLED test_nhwc_autocast_jit_trace_model (__main__.TestJitTraceAutocast)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Traceback (most recent call last): File "/var/lib/jenkins/workspace/test/test_jit_autocast.py", line 853, in test_nhwc_autocast_jit_trace_model test_nhwc_autocast_jit_trace_model(self.models[i], self.inputs[i]) File "/var/lib/jenkins/workspace/test/test_jit_autocast.py", line 848, in test_nhwc_autocast_jit_trace_model torch.testing.assert_close(y.double(), y2.double(), rtol=1e-03, atol=1e-03) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1631, in assert_close raise error_metas[0].to_error(msg) AssertionError: Tensor-likes are not close!

Mismatched elements: 4 / 24332288 (0.0%) Greatest absolute difference: 0.44140625 at index (29, 12, 78, 60) (up to 0.001 allowed) Greatest relative difference: 1.6142857142857143 at index (29, 12, 78, 60) (up to 0.001 allowed)

To execute this test, run the following from the base repo dir: python test/test_jit_autocast.py TestJitTraceAutocast.test_nhwc_autocast_jit_trace_model

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

Root Cause

This test was disabled because it is failing in CI. See recent examples and the most recent trunk workflow logs.

Code Example

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/test_jit_autocast.py", line 853, in test_nhwc_autocast_jit_trace_model
    test_nhwc_autocast_jit_trace_model(self.models[i], self.inputs[i])
  File "/var/lib/jenkins/workspace/test/test_jit_autocast.py", line 848, in test_nhwc_autocast_jit_trace_model
    torch.testing.assert_close(y.double(), y2.double(), rtol=1e-03, atol=1e-03)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1631, in assert_close
    raise error_metas[0].to_error(msg)
AssertionError: Tensor-likes are not close!

Mismatched elements: 4 / 24332288 (0.0%)
Greatest absolute difference: 0.44140625 at index (29, 12, 78, 60) (up to 0.001 allowed)
Greatest relative difference: 1.6142857142857143 at index (29, 12, 78, 60) (up to 0.001 allowed)

To execute this test, run the following from the base repo dir:
    python test/test_jit_autocast.py TestJitTraceAutocast.test_nhwc_autocast_jit_trace_model

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
RAW_BUFFERClick to expand / collapse

Platforms: linux

This test was disabled because it is failing in CI. See recent examples and the most recent trunk workflow logs.

Over the past 6 hours, it has been determined flaky in 5 workflow(s) with 5 failures and 5 successes.

Debugging instructions (after clicking on the recent samples link): DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets:

  1. Click on the workflow logs linked above
  2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
  3. Grep for test_nhwc_autocast_jit_trace_model
  4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.
<details><summary>Sample error message</summary>
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/test_jit_autocast.py", line 853, in test_nhwc_autocast_jit_trace_model
    test_nhwc_autocast_jit_trace_model(self.models[i], self.inputs[i])
  File "/var/lib/jenkins/workspace/test/test_jit_autocast.py", line 848, in test_nhwc_autocast_jit_trace_model
    torch.testing.assert_close(y.double(), y2.double(), rtol=1e-03, atol=1e-03)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1631, in assert_close
    raise error_metas[0].to_error(msg)
AssertionError: Tensor-likes are not close!

Mismatched elements: 4 / 24332288 (0.0%)
Greatest absolute difference: 0.44140625 at index (29, 12, 78, 60) (up to 0.001 allowed)
Greatest relative difference: 1.6142857142857143 at index (29, 12, 78, 60) (up to 0.001 allowed)

To execute this test, run the following from the base repo dir:
    python test/test_jit_autocast.py TestJitTraceAutocast.test_nhwc_autocast_jit_trace_model

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
</details>

Test file path: test_jit_autocast.py

For all disabled tests (by GitHub issue), see https://hud.pytorch.org/disabled.

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel

extent analysis

TL;DR

The test test_nhwc_autocast_jit_trace_model is failing due to assertion errors in tensor comparisons, suggesting a potential issue with numerical precision or model behavior.

Guidance

  • Review the provided recent examples and workflow logs to understand the failure patterns.
  • Follow the debugging instructions to find relevant log snippets by grepping for test_nhwc_autocast_jit_trace_model in the workflow logs.
  • Investigate the assertion error in torch.testing.assert_close to determine if the issue is related to numerical precision, model implementation, or test setup.
  • Consider relaxing the tolerance values (rtol and atol) in torch.testing.assert_close to see if the test passes with less stringent comparison criteria.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather an investigation into the test failure.

Notes

The issue is marked as flaky, indicating that it may not fail consistently, which can make debugging more challenging. The provided error message suggests a small percentage of mismatched elements, which might be due to numerical precision issues or model behavior.

Recommendation

Apply workaround: Relax the tolerance values in torch.testing.assert_close to temporarily mitigate the issue while further investigation is conducted to determine the root cause.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix DISABLED test_nhwc_autocast_jit_trace_model (__main__.TestJitTraceAutocast)