Skip to content

Fix undefined names in tests - #3

Merged
cyyever merged 1 commit into
trimfrom
fix-undefined-names
Oct 23, 2026
Merged

cyyever merged 1 commit into
trimfrom
fix-undefined-names

Conversation

@cyyever

@cyyever cyyever commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ruff reported 130 F821 in test/. Most were missing imports left by earlier trim edits and upstream merges; they are added back.
  • Two broken conflict resolutions are repaired:
    • test_cpp_extensions_jit: test_inline_jit_generated_bindings_keep_gil_disabled is restored, and the half-deleted MPS test is dropped.
    • test_fx: the _capture_gm helper is restored, and the partial duplicate of test_profiler_stack_trace_augmentation is dropped.
  • test_foreach checked an undefined is_cuda; it now checks "cuda" in device again.
  • test_libtorch_agnostic: the 2.15 extension is always installed and the version skips are dropped, since this torch is at least 2.15.
  • Leftovers of removed features are deleted: the Halide skips, the MTIA interface check, the quantized resize test, the JitTestCase bases, and instantiate calls for test classes that no longer exist.

Test plan

  • ruff check --select F821 torch test benchmarks tools functorch: 0 (was 130)
  • The 26 changed files compile and gain no new F401 compared with trim.
  • Running the affected test files (not done)

🤖 Generated with Claude Code

ruff reported 130 F821 in test/. Most were imports dropped by earlier
trim edits and upstream merges; add them back. The rest:

- Two conflict resolutions cut code in half. test_cpp_extensions_jit lost
  test_inline_jit_generated_bindings_keep_gil_disabled to the XPU tests,
  leaving its last assertion in test_mps_extension. test_fx lost the
  _capture_gm helper to a partial copy of
  test_profiler_stack_trace_augmentation. Restore both, and drop the
  MPS test and the duplicate.
- test_foreach checked an undefined is_cuda; restore "cuda" in device.
- test_libtorch_agnostic: drop the skipIfTorchVersionLessThan skips and
  the 2.15 version check; this torch is at least 2.15.
- Remove leftovers of removed features: the Halide skips, the MTIA
  device interface check, the quantized resize test, JitTestCase bases,
  and instantiate calls for test classes that no longer exist.

ruff now reports no F821 in torch/ and test/, and no new F401.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cyyever
cyyever merged commit db71170 into trim Oct 23, 2026
16 checks passed
@cyyever
cyyever deleted the fix-undefined-names branch October 23, 2026 00:57
cyyever added a commit that referenced this pull request Oct 27, 2026
ruff reported 130 F821 in test/. Most were imports dropped by earlier
trim edits and upstream merges; add them back. The rest:

- Two conflict resolutions cut code in half. test_cpp_extensions_jit lost
  test_inline_jit_generated_bindings_keep_gil_disabled to the XPU tests,
  leaving its last assertion in test_mps_extension. test_fx lost the
  _capture_gm helper to a partial copy of
  test_profiler_stack_trace_augmentation. Restore both, and drop the
  MPS test and the duplicate.
- test_foreach checked an undefined is_cuda; restore "cuda" in device.
- test_libtorch_agnostic: drop the skipIfTorchVersionLessThan skips and
  the 2.15 version check; this torch is at least 2.15.
- Remove leftovers of removed features: the Halide skips, the MTIA
  device interface check, the quantized resize test, JitTestCase bases,
  and instantiate calls for test classes that no longer exist.

ruff now reports no F821 in torch/ and test/, and no new F401.

Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever added a commit that referenced this pull request Oct 31, 2026
ruff reported 130 F821 in test/. Most were imports dropped by earlier
trim edits and upstream merges; add them back. The rest:

- Two conflict resolutions cut code in half. test_cpp_extensions_jit lost
  test_inline_jit_generated_bindings_keep_gil_disabled to the XPU tests,
  leaving its last assertion in test_mps_extension. test_fx lost the
  _capture_gm helper to a partial copy of
  test_profiler_stack_trace_augmentation. Restore both, and drop the
  MPS test and the duplicate.
- test_foreach checked an undefined is_cuda; restore "cuda" in device.
- test_libtorch_agnostic: drop the skipIfTorchVersionLessThan skips and
  the 2.15 version check; this torch is at least 2.15.
- Remove leftovers of removed features: the Halide skips, the MTIA
  device interface check, the quantized resize test, JitTestCase bases,
  and instantiate calls for test classes that no longer exist.

ruff now reports no F821 in torch/ and test/, and no new F401.

Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever added a commit that referenced this pull request Oct 31, 2026
Drop SM70OrLater skips left behind in tests

d3f4404 removed SM53OrLater/SM70OrLater from common_cuda because the
sm_100 floor makes them always true, but test_cuda.py and
test_control_flow.py still imported them and failed at import. Remove the
imports and the skips, which can never fire.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Remove references to dropped platforms and AMD archs from tests (#2)

The trim removed Windows, s390x and SVE256 support and AMD hardware below
gfx1150, but tests and torch.testing helpers still referenced IS_WINDOWS,
IS_S390X, IS_CPU_CAPABILITY_SVE256, MI200_ARCH, MI300_ARCH and NAVI3_ARCH.
common_methods_invocations imported MI200_ARCH, so every test importing
it (test_cuda.py among them) failed at collection.

Delete IS_WINDOWS from common_utils and fold these always-false flags out
of conditions, conditional expressions, `if` blocks and skip/xfail
decorators, dropping the imports and the skips that can no longer fire.
ck_tile grouped-gemm checks keep only gfx950. ruff reports no new F821 or
F401 in the touched files.

Co-authored-by: Claude Opus 5.5 <[email protected]>

Fix undefined names in tests (#3)

ruff reported 130 F821 in test/. Most were imports dropped by earlier
trim edits and upstream merges; add them back. The rest:

- Two conflict resolutions cut code in half. test_cpp_extensions_jit lost
  test_inline_jit_generated_bindings_keep_gil_disabled to the XPU tests,
  leaving its last assertion in test_mps_extension. test_fx lost the
  _capture_gm helper to a partial copy of
  test_profiler_stack_trace_augmentation. Restore both, and drop the
  MPS test and the duplicate.
- test_foreach checked an undefined is_cuda; restore "cuda" in device.
- test_libtorch_agnostic: drop the skipIfTorchVersionLessThan skips and
  the 2.15 version check; this torch is at least 2.15.
- Remove leftovers of removed features: the Halide skips, the MTIA
  device interface check, the quantized resize test, JitTestCase bases,
  and instantiate calls for test classes that no longer exist.

ruff now reports no F821 in torch/ and test/, and no new F401.

Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever added a commit that referenced this pull request Oct 31, 2026
Drop SM70OrLater skips left behind in tests

d3f4404 removed SM53OrLater/SM70OrLater from common_cuda because the
sm_100 floor makes them always true, but test_cuda.py and
test_control_flow.py still imported them and failed at import. Remove the
imports and the skips, which can never fire.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Remove references to dropped platforms and AMD archs from tests (#2)

The trim removed Windows, s390x and SVE256 support and AMD hardware below
gfx1150, but tests and torch.testing helpers still referenced IS_WINDOWS,
IS_S390X, IS_CPU_CAPABILITY_SVE256, MI200_ARCH, MI300_ARCH and NAVI3_ARCH.
common_methods_invocations imported MI200_ARCH, so every test importing
it (test_cuda.py among them) failed at collection.

Delete IS_WINDOWS from common_utils and fold these always-false flags out
of conditions, conditional expressions, `if` blocks and skip/xfail
decorators, dropping the imports and the skips that can no longer fire.
ck_tile grouped-gemm checks keep only gfx950. ruff reports no new F821 or
F401 in the touched files.

Co-authored-by: Claude Opus 5.5 <[email protected]>

Fix undefined names in tests (#3)

ruff reported 130 F821 in test/. Most were imports dropped by earlier
trim edits and upstream merges; add them back. The rest:

- Two conflict resolutions cut code in half. test_cpp_extensions_jit lost
  test_inline_jit_generated_bindings_keep_gil_disabled to the XPU tests,
  leaving its last assertion in test_mps_extension. test_fx lost the
  _capture_gm helper to a partial copy of
  test_profiler_stack_trace_augmentation. Restore both, and drop the
  MPS test and the duplicate.
- test_foreach checked an undefined is_cuda; restore "cuda" in device.
- test_libtorch_agnostic: drop the skipIfTorchVersionLessThan skips and
  the 2.15 version check; this torch is at least 2.15.
- Remove leftovers of removed features: the Halide skips, the MTIA
  device interface check, the quantized resize test, JitTestCase bases,
  and instantiate calls for test classes that no longer exist.

ruff now reports no F821 in torch/ and test/, and no new F401.

Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever added a commit that referenced this pull request Oct 31, 2026
Drop SM70OrLater skips left behind in tests

d3f4404 removed SM53OrLater/SM70OrLater from common_cuda because the
sm_100 floor makes them always true, but test_cuda.py and
test_control_flow.py still imported them and failed at import. Remove the
imports and the skips, which can never fire.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Remove references to dropped platforms and AMD archs from tests (#2)

The trim removed Windows, s390x and SVE256 support and AMD hardware below
gfx1150, but tests and torch.testing helpers still referenced IS_WINDOWS,
IS_S390X, IS_CPU_CAPABILITY_SVE256, MI200_ARCH, MI300_ARCH and NAVI3_ARCH.
common_methods_invocations imported MI200_ARCH, so every test importing
it (test_cuda.py among them) failed at collection.

Delete IS_WINDOWS from common_utils and fold these always-false flags out
of conditions, conditional expressions, `if` blocks and skip/xfail
decorators, dropping the imports and the skips that can no longer fire.
ck_tile grouped-gemm checks keep only gfx950. ruff reports no new F821 or
F401 in the touched files.

Co-authored-by: Claude Opus 5.5 <[email protected]>

Fix undefined names in tests (#3)

ruff reported 130 F821 in test/. Most were imports dropped by earlier
trim edits and upstream merges; add them back. The rest:

- Two conflict resolutions cut code in half. test_cpp_extensions_jit lost
  test_inline_jit_generated_bindings_keep_gil_disabled to the XPU tests,
  leaving its last assertion in test_mps_extension. test_fx lost the
  _capture_gm helper to a partial copy of
  test_profiler_stack_trace_augmentation. Restore both, and drop the
  MPS test and the duplicate.
- test_foreach checked an undefined is_cuda; restore "cuda" in device.
- test_libtorch_agnostic: drop the skipIfTorchVersionLessThan skips and
  the 2.15 version check; this torch is at least 2.15.
- Remove leftovers of removed features: the Halide skips, the MTIA
  device interface check, the quantized resize test, JitTestCase bases,
  and instantiate calls for test classes that no longer exist.

ruff now reports no F821 in torch/ and test/, and no new F401.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant