PR #39201: [xla:gpu] Split legacy custom calls into LegacyCustomCallThunk#40368
Open
copybara-service[bot] wants to merge 1 commit intomainfrom
Open
PR #39201: [xla:gpu] Split legacy custom calls into LegacyCustomCallThunk#40368copybara-service[bot] wants to merge 1 commit intomainfrom
copybara-service[bot] wants to merge 1 commit intomainfrom
Conversation
…hunk Imported from GitHub PR #39201 Split `CustomCallThunk` into two separate classes to cleanly separate FFI from legacy custom call APIs (to be deleted). This change is **NFC**, simply splitting existing thunk/command into two classes to clearly separate legacy calling conventions from FFI. - **`CustomCallThunk`** — now exclusively handles XLA FFI custom calls. Simplified by removing all legacy code paths, optional bundle checks, and the `ExecuteCustomCall()` fallback. The `bundle_` field is now a plain `std::variant` (always present) instead of `std::optional<std::variant>`. - **`LegacyCustomCallThunk`** (new) — handles deprecated legacy custom calls (`API_VERSION_STATUS_RETURNING`, etc.) using `CustomCallTargetRegistry`. Marked as deprecated in its class comment, directing users to FFI via `CustomCallThunk`. Also split `CustomCallCmd` in the command buffer layer into: - **`CustomCallCmd`** — FFI only, builds `ffi::CallFrame` and invokes FFI handlers directly. - **`LegacyCustomCallCmd`** — legacy only, traces custom call execution via `TraceCommandBufferFactory`. Unified `CustomCallThunk` accumulated too much complexity related to dispatching between two unrelated custom all ABIs, by splitting them into separate files we can keep on improving FFI without having to deal with legacy custom calls. Copybara import of the project: -- 2d33e5b by Eugene Zhulenev <ezhulenev@openxla.org>: [xla:gpu] Split legacy custom calls into LegacyCustomCallThunk Merging this change closes #39201 FUTURE_COPYBARA_INTEGRATE_REVIEW=#39201 from ezhulenev:split-custom-call-thunk 2d33e5b PiperOrigin-RevId: 894119940
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #39201: [xla:gpu] Split legacy custom calls into LegacyCustomCallThunk
Imported from GitHub PR #39201
Split
CustomCallThunkinto two separate classes to cleanly separate FFI from legacy custom call APIs (to be deleted). This change is NFC, simply splitting existing thunk/command into two classes to clearly separate legacy calling conventions from FFI.CustomCallThunk— now exclusively handles XLA FFI custom calls. Simplified by removing all legacy code paths, optional bundle checks, and theExecuteCustomCall()fallback. Thebundle_field is now a plainstd::variant(always present) instead ofstd::optional<std::variant>.LegacyCustomCallThunk(new) — handles deprecated legacy custom calls (API_VERSION_STATUS_RETURNING, etc.) usingCustomCallTargetRegistry. Marked as deprecated in its class comment, directing users to FFI viaCustomCallThunk.Also split
CustomCallCmdin the command buffer layer into:CustomCallCmd— FFI only, buildsffi::CallFrameand invokes FFI handlers directly.LegacyCustomCallCmd— legacy only, traces custom call execution viaTraceCommandBufferFactory.Unified
CustomCallThunkaccumulated too much complexity related to dispatching between two unrelated custom all ABIs, by splitting them into separate files we can keep on improving FFI without having to deal with legacy custom calls.Copybara import of the project:
--
2d33e5b by Eugene Zhulenev ezhulenev@openxla.org:
[xla:gpu] Split legacy custom calls into LegacyCustomCallThunk
Merging this change closes #39201
FUTURE_COPYBARA_INTEGRATE_REVIEW=#39201 from ezhulenev:split-custom-call-thunk 2d33e5b