Skip to content

Conversation

@zasdfgbnm
Copy link
Collaborator

No description provided.

@zasdfgbnm
Copy link
Collaborator Author

!test

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Review updated until commit 5a784d4

Description

  • Add new utility function resetContiguityFromTensor to ir_utils namespace

  • Function infers and resets TensorView contiguity based on actual at::Tensor sizes and strides

  • Handles broadcast and reduction dimensions correctly by setting their contiguity to nullopt

  • Includes comprehensive test coverage with 8 test cases covering all contiguity combinations

Changes walkthrough

Relevant files
Enhancement
utils.cpp
Implement resetContiguityFromTensor utility function         

csrc/ir/utils.cpp

  • Added new function resetContiguityFromTensor implementation
  • Includes custom contiguity inference logic that handles broadcast and
    reduction dimensions
  • Computes contiguity by comparing consecutive strides in allocation
    domain
  • Added necessary include for tensor_metadata.h
  • +63/-0   
    utils.h
    Add function declaration and documentation                             

    csrc/ir/utils.h

  • Added function declaration for resetContiguityFromTensor
  • Included detailed documentation explaining function behavior and
    parameters
  • Function takes TensorView pointer and at::Tensor reference as
    parameters
  • +6/-0     
    Tests
    test_utils.cpp
    Add comprehensive tests for resetContiguityFromTensor       

    tests/cpp/test_utils.cpp

  • Added comprehensive test ResetContiguityFromTensor with 8 test cases
  • Tests all contiguity combinations for mixed dimension types
    (iteration, broadcast, reduction)
  • Verifies correct handling of broadcast (nullopt) and reduction
    (nullopt) dimensions
  • Tests complex allocation domain pattern with non-leftmost broadcast
    dimension
  • +109/-0 

    PR Reviewer Guide

    Here are some key observations to aid the review process:

    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    @zasdfgbnm
    Copy link
    Collaborator Author

    !test

    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