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

[JAX] Implement an initial object API for colocated Python #26626

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

[JAX] Implement an initial object API for colocated Python

Colocated Python adds colocated_python_class. This API wraps a user-defined
class for automatic remoting of object construction/destruction and method calls:

  • An object will be initialized on the backend. At least for now,
    initialization is deferred until the first method is called; at this point,
    colocated Python knows what devices the objects should be accessible and thus
    it can construct the object(s).

  • When an object method is called, the method call runs as a colocated Python
    function call on the backend.

  • When the object is destroyed (either by reaching a zero reference count or
    through Python GC), destruction also runs as a colocated Python function call
    and destroys all objects from the backend.

This change provides an intial API implementation. Main limitations are as
follows:

  • The methods of a colocated Python class does not support specialization.
    Calling it requires at least one argument.

  • Colocated Python objects cannot reference or interact with each other on the
    controller or on the colocated Python backend.

These limitations will be lifted as the object API implementation is improved.

@copybara-service copybara-service bot force-pushed the test_720733692 branch 4 times, most recently from b4a9937 to 5fde5f3 Compare February 21, 2025 20:45
@copybara-service copybara-service bot closed this Feb 21, 2025
@copybara-service copybara-service bot deleted the test_720733692 branch February 21, 2025 20:58
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.

0 participants