Skip to content

Conversation

@shino16
Copy link
Collaborator

@shino16 shino16 commented Nov 19, 2025

This is to fix the AssertionError reported in #2677 (comment).
See #2746 (comment) for the discussion on correctness.

I added a test for this, which was the first test related to DTensors with dynamic shapes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an AssertionError that occurs when creating TensorProxy objects with dynamic shapes for DTensors that lack history information. The fix ensures that when a tensor's history is unavailable, the shape's IntegerProxy objects are created with history=None instead of attempting to construct a ProvenanceRecord from a None value.

  • Modified the tensorproxy function to conditionally create shape provenance records only when history is available
  • Added the first test case for DTensor with dynamic shapes to ensure proper caching behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
thunder/core/proxies.py Added conditional logic to handle None history when creating shape IntegerProxy objects for symbolic values
thunder/tests/distributed/test_dtensor.py Added test case for DTensor.from_local with symbolic values caching to verify dynamic shape handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@kshitij12345 kshitij12345 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @shino16

@KaelanDt KaelanDt merged commit 879f8bf into main Nov 26, 2025
51 checks passed
@KaelanDt KaelanDt deleted the fix-2677-incomplete-provenance branch November 26, 2025 12:50
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.

3 participants