Skip to content

Conversation

@leshy
Copy link
Contributor

@leshy leshy commented Feb 9, 2026

Skip metric3d depth inference tests gracefully when xformers memory_efficient_attention is unsupported (e.g. compute capability > 9.0) - this fails on my machine

On GPUs with compute capability > 9.0 (e.g. Blackwell), xformers
memory_efficient_attention raises NotImplementedError. Skip these
tests gracefully instead of failing.
@greptile-apps
Copy link

greptile-apps bot commented Feb 9, 2026

Greptile Overview

Greptile Summary

This PR updates the Metric3D GPU inference tests to gracefully skip when xformers' memory_efficient_attention is not implemented on the current GPU (e.g., newer compute capabilities). It does this by wrapping Metric3D.infer_depth(...) calls in a small context manager that catches NotImplementedError containing the memory_efficient_attention substring and calls pytest.skip, while re-raising all other errors so genuine regressions still fail.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Change is isolated to tests and only converts a known NotImplementedError case into a pytest skip; all other exceptions still fail the tests, preserving signal for real regressions.
  • No files require special attention

Important Files Changed

Filename Overview
dimos/models/depth/test_metric3d.py Wraps Metric3D infer_depth calls in a contextmanager that skips tests when xformers raises NotImplementedError for memory_efficient_attention; otherwise re-raises.

Sequence Diagram

sequenceDiagram
    participant Pytest as pytest
    participant Test as test_metric3d.py
    participant M3D as Metric3D
    participant XF as xformers

    Pytest->>Test: run test_metric3d_infer_depth / multiple_inferences
    Test->>M3D: start()
    loop each inference
        Test->>Test: enter skip_xformers_unsupported()
        Test->>M3D: infer_depth(rgb_array)
        M3D->>XF: memory_efficient_attention(...)
        alt xformers unsupported GPU
            XF-->>M3D: raise NotImplementedError("...memory_efficient_attention...")
            M3D-->>Test: propagate exception
            Test-->>Pytest: pytest.skip(...)
        else supported
            XF-->>M3D: return attention result
            M3D-->>Test: return depth_map
            Test-->>Test: exit context manager
        end
    end
    Test->>M3D: stop()
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@leshy leshy merged commit 4398bb5 into dev Feb 11, 2026
15 checks passed
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.

2 participants