pytorch - ✅(Solved) Fix Migrate device-agnostic skips from `op_db` to `@skipOps` [2 pull requests, 1 comments, 2 participants]

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…
GitHub stats
pytorch/pytorch#177259Fetched 2026-04-08 00:42:32
View on GitHub
Comments
1
Participants
2
Timeline
17
Reactions
0
Author
Participants
Timeline (top)
labeled ×4mentioned ×3subscribed ×3cross-referenced ×2

Fix Action

Fixed

PR fix notes

PR #1: [WIP] Migrate device-agnostic DecorateInfo skips from op_db to @skipOps

Description (problem / solution / changelog)

Working on file change, one commit a time. fixes #177259

@fffrog @mruberry

  • signal.py file
  • functorch_additional_op_db.py
  • linalg.py
  • test_hop.py

Changed files

  • test/export/test_hop.py (modified, +45/-0)
  • test/functorch/functorch_additional_op_db.py (modified, +0/-124)
  • test/functorch/test_vmap.py (modified, +24/-0)
  • test/test_fx.py (modified, +19/-1)
  • test/test_fx_experimental.py (modified, +16/-1)
  • test/test_jit_fuser_te.py (modified, +8/-1)
  • test/test_mps.py (modified, +21/-0)
  • test/test_ops.py (modified, +22/-0)
  • test/test_ops_fwd_gradients.py (modified, +11/-1)
  • test/test_ops_gradients.py (modified, +13/-1)
  • test/test_ops_jit.py (modified, +30/-1)
  • torch/testing/_internal/hop_db.py (modified, +1/-34)
  • torch/testing/_internal/opinfo/definitions/signal.py (modified, +1/-52)

PR #177666: [WIP] Migrate device-agnostic DecorateInfo skips from op_db to @skipOps

Description (problem / solution / changelog)

Working on file change, one commit a time. fixes #177259

@fffrog @mruberry

  • signal.py file
  • functorch_additional_op_db.py
  • linalg.py
  • test_hop.py

Changed files

  • test/export/test_hop.py (modified, +54/-0)
  • test/functorch/functorch_additional_op_db.py (modified, +10/-102)
  • test/functorch/test_vmap.py (modified, +24/-0)
  • test/test_fx.py (modified, +19/-1)
  • test/test_mps.py (modified, +21/-0)
  • test/test_ops.py (modified, +22/-0)
  • test/test_ops_jit.py (modified, +19/-1)
  • torch/testing/_internal/hop_db.py (modified, +1/-34)
  • torch/testing/_internal/opinfo/definitions/signal.py (modified, +1/-52)

Code Example

# Before
op_db = [
    OpInfo('item',
          ...
          skips=(
              DecorateInfo(unittest.expectedFailure, 'TestFakeTensor', 'test_fake'),
              DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_dtypes', device_type='mps'),
            )
          ),
    ...
]

@ops(op_db, dtypes=OpDTypes.any_one)
def test_fake(self, device, dtype, op):
    ...

# After
op_db = [
    OpInfo('item',
          ...
          skips=(
              DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_dtypes', device_type='mps'),
            )
          ),
    ...
]

@skipOps(
    {
         xfail(“item”)
    }
)
@ops(op_db, dtypes=OpDTypes.any_one)
def test_fake(self, device, dtype, op):
    ...
RAW_BUFFERClick to expand / collapse

Move the device-agnostic DecorateInfo skip entries scattered in op_db to the @skipOps decorators on the corresponding testcases. After the migration, op_db will only keep the intrinsic properties of operators (such as inputs and outputs) and device-specific skip/decorators (which ideally should also be removed).

# Before
op_db = [
    OpInfo('item',
          ...
          skips=(
              DecorateInfo(unittest.expectedFailure, 'TestFakeTensor', 'test_fake'),
              DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_dtypes', device_type='mps'),
            )
          ),
    ...
]

@ops(op_db, dtypes=OpDTypes.any_one)
def test_fake(self, device, dtype, op):
    ...

# After
op_db = [
    OpInfo('item',
          ...
          skips=(
              DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_dtypes', device_type='mps'),
            )
          ),
    ...
]

@skipOps(
    {
         xfail(“item”)
    }
)
@ops(op_db, dtypes=OpDTypes.any_one)
def test_fake(self, device, dtype, op):
    ...

cc @mruberry

extent analysis

Fix Plan

To migrate the device-agnostic DecorateInfo skip entries from op_db to the @skipOps decorators, follow these steps:

  • Identify the DecorateInfo entries in op_db that are device-agnostic.
  • Create a dictionary for the @skipOps decorator with xfail or other relevant decorators.
  • Move the device-agnostic DecorateInfo entries to the @skipOps dictionary.
  • Remove the device-agnostic DecorateInfo entries from op_db.

Example Code

# Before
op_db = [
    OpInfo('item',
          ...
          skips=(
              DecorateInfo(unittest.expectedFailure, 'TestFakeTensor', 'test_fake'),
              DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_dtypes', device_type='mps'),
            )
          ),
    ...
]

# After
op_db = [
    OpInfo('item',
          ...
          skips=(
              DecorateInfo(unittest.expectedFailure, 'TestCommon', 'test_dtypes', device_type='mps'),
            )
          ),
    ...
]

@skipOps(
    {
        xfail("item")
    }
)
@ops(op_db, dtypes=OpDTypes.any_one)
def test_fake(self, device, dtype, op):
    ...

# Example of moving device-agnostic DecorateInfo to @skipOps
skip_ops_dict = {
    xfail("item"): unittest.expectedFailure
}

@skipOps(skip_ops_dict)
@ops(op_db, dtypes=OpDTypes.any_one)
def test_fake(self, device, dtype, op):
    ...

Verification

Verify that the tests run successfully after the migration and that the device-agnostic skip entries are correctly applied.

Extra Tips

  • Make sure to update the op_db and @skipOps decorators consistently to avoid inconsistencies.
  • Test the changes thoroughly to ensure that the migration does not introduce any regressions.

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 - ✅(Solved) Fix Migrate device-agnostic skips from `op_db` to `@skipOps` [2 pull requests, 1 comments, 2 participants]