Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Proper Locations for Golden IDs #1488

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Use Proper Locations for Golden IDs #1488

merged 1 commit into from
Dec 10, 2024

Conversation

ctodTT
Copy link
Contributor

@ctodTT ctodTT commented Dec 3, 2024

This change swaps the UUID for golden tensors from only a monotonically increasing id to a filename and line number as well.

Closes #1300

Copy link
Contributor

@nsmithtt nsmithtt left a comment

Choose a reason for hiding this comment

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

🙌

@tapspatel
Copy link
Contributor

tapspatel commented Dec 4, 2024

extremely clean and great change

std::string getOpLocInfo(OpContext opContextHandle) {
  auto const &opContext =
      opContextHandle.as<::tt::target::ttnn::Operation>(DeviceRuntime::TTNN);
  return std::string(opContext.loc_info()->c_str());
}

Thanks @ctodTT + @vprajapati-tt :)

Copy link
Contributor

@vprajapati-tt vprajapati-tt left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM

Comment on lines -116 to -124
# find matching golden tensor based on loc in op debug string
match = re.search(r"loc\(([^)]+)\)", op_debug_str)

if not match:
print(f"debug_str={op_debug_str}")
print("No location found in debug string - skipping golden comparison")
return

loc = match.group(1).replace('"', "")
Copy link
Contributor

Choose a reason for hiding this comment

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

RegeXcted 🔥

Copy link
Contributor

Choose a reason for hiding this comment

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

re.sub("re\..*", "")

@ctodTT ctodTT merged commit a03922b into main Dec 10, 2024
20 checks passed
ctodTT added a commit that referenced this pull request Dec 11, 2024
ctodTT added a commit that referenced this pull request Dec 11, 2024
ctodTT added a commit that referenced this pull request Dec 11, 2024
ctodTT added a commit that referenced this pull request Dec 11, 2024
* PyBind `GoldenTensor` w/ Integral Types

This change introduces a PyBound class `GoldenTensor` that reflects the
same type from TTRT. This binding supports the following element types
for a `GoldenTensor`:
  - uint8
  - uint16
  - uint32
  - float32

Also, this change reverts PR #1488 , as it broke some things unintentionally. This is to be able to address these problems in a separate PR. 

Closes #1334
azecevicTT pushed a commit that referenced this pull request Dec 17, 2024
* PyBind `GoldenTensor` w/ Integral Types

This change introduces a PyBound class `GoldenTensor` that reflects the
same type from TTRT. This binding supports the following element types
for a `GoldenTensor`:
  - uint8
  - uint16
  - uint32
  - float32

Also, this change reverts PR #1488 , as it broke some things unintentionally. This is to be able to address these problems in a separate PR. 

Closes #1334
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.

Proper stack trace in loc() extraction during golden callback
4 participants