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

#9837: Assign workers after performing ref count cleanup in async mode #9944

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

tt-asaigal
Copy link
Contributor

@tt-asaigal tt-asaigal commented Jul 3, 2024

Ticket

#9837

Problem description

Segfault seen when generating rotation matrix cache for LLMs. Was never seen on CI, since these runners have the cache already created.

What's changed

Reference count management for tensors was erroneous. This case was not correctly supported:

device_tensor = device_tensor.cpu()

The reference count for the device tensor would not get decremented post assignment.

Assign worker vector after decrementing ref count when calling the tensor copy or move assignment operators.

Checklist

  • Post commit CI passes
  • Model regression CI testing passes (if applicable)
  • New/Existing tests provide coverage for changes

  - This handles cases where a device tensor is reassigned to a host tensor
  - Exposed during model cache generation which uses the following pattern:
      device_tensor = device_tensor.cpu()
@tt-asaigal tt-asaigal force-pushed the asaigal/cache_gen_segfault_rebased branch from 4558673 to 112ea79 Compare July 4, 2024 16:46
@tt-asaigal tt-asaigal merged commit d0ac529 into main Jul 4, 2024
5 checks passed
@tt-asaigal tt-asaigal deleted the asaigal/cache_gen_segfault_rebased branch July 4, 2024 16:47
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