Skip to content

Conversation

@ign-krishnanand
Copy link
Collaborator

@ign-krishnanand ign-krishnanand commented Sep 11, 2025

What's changed

Added TT implementation of Selective Super Resolution (SSR) model in tt-metal.

Results

PCC Score

Hardware: Wormhole n150:

Output Random weights and input data
SR output 0.9999265025206074
Features output 0.9897763897274661

Note

Code refactoring and optimisation are still in progress.

Torch Fallback usage in code

  • Tensor unpadding (window_attn_tr.py, OCAB.py):

    • ttnn.transformer operation requirement: Head size must be a multiple of 32.
    • Weight and Bias padding to the initial linear layer, ensures compatibility with ttnn.transformer operations.
    • resulting Tensor output from ttnn.transformer operations is unpaded.
  • Pixel Shuffle Optimization (upsample.py):

    • Used torch.nn.functional.pixel_shuffle instead of manual reshapes and permute operations.
    • Provides significant performance improvements during upsampling.
  • Bicubic Upsample (ssr.py):

    • TTNN currently does not support bicubic interpolation mode for the ttnn.upsample operation.
      Approximation with ttnn upsample with mode as bilinear was resulting in lower pcc.
  • Window Reverse (test_ssr.py):

    • Window reverse was performed on the host for SSR without convolution, as it is the final layer and can be treated as post-processing.

Checklist

Copy link

@dvartaniansTT dvartaniansTT left a comment

Choose a reason for hiding this comment

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

Please add a README that includes a brief intro to the model.
instructions to set up the proper env to run pytests and the command to run them and what each test does.
also include the device and end to perf numbers in the README. use this as an example

@ign-saurav ign-saurav marked this pull request as ready for review September 17, 2025 14:27
Copy link

@dvartaniansTT dvartaniansTT left a comment

Choose a reason for hiding this comment

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

LGTM

@ign-saurav
Copy link
Owner

Hi @mbezuljTT, Could you please review the PR?

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.

6 participants