Skip to content

Conversation

Essoz
Copy link
Collaborator

@Essoz Essoz commented Feb 20, 2025

Context:

We needed to apply a unproxy wrapper to every built-in API as passing Proxy objects into the backend causes segmentation fault.

However, this unproxy step is not very efficient as it requires iterating and type-checking every argument every time a low-level (presumably also a very frequently-called) API is being invoked, leading to performance overheads.

Also, generally we want to reduce number of APIs instrumented to (1) lower the overhead & (2) reduce the intrusiveness of our instrumentation.

Why:
The segmentation fault issue has been resolved by #115 which uses __torch_function__ to automatically unproxy objects when a Proxy object is being dispatched.

TODOs:

  • Remove all steps to add unproxy wrappers in global_wrapper except when adding observers.
  • Remove core_wrapper completely.
  • Conduct a new round of overhead experiments to justify the change.

@Essoz
Copy link
Collaborator Author

Essoz commented Mar 2, 2025

We cannot get rid of unproxy logic entirely as somehow there's segmentation fault once we do so. We will probably need to understand the source of the segmentation faults better by inspecting the core-dump files and make decisions about what to get rid of.

@Essoz Essoz added enhancement New feature or request overhead oss-eng Tasks necessary to become a practical engineering tool labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request oss-eng Tasks necessary to become a practical engineering tool overhead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant