feat(pjrt): add program execution to LoadedExecutable#70
Closed
feat(pjrt): add program execution to LoadedExecutable#70
Conversation
…fecycle) T60.2.1: BufferFromHost wraps PJRT_Client_BufferFromHostBuffer with Go type to PJRT element type mapping (F32, F64, F16, BF16, F8E4M3, S32, S64, etc.), shape validation, and buffer donation support. T60.2.2: ToHost/ToHostSlice wraps PJRT_Buffer_ToHostBuffer with async readback and PJRT_Event_Await synchronization. T60.2.3: Buffer metadata (Dtype, Shape, OnDeviceSizeInBytes, ReadyEvent) and lifecycle (Close, Delete) with double-close no-op for finalizer safety.
Add ccall, dlopenPath, and dlsym forwarding functions in pjrt.go so that buffer.go, client.go, and device.go do not import internal/cuda directly. Only pjrt.go holds the cuda dependency.
Implement LoadedExecutable.Execute(inputs []*Buffer, opts ...ExecOption) which wraps PJRT_LoadedExecutable_Execute. Builds input/output buffer handle arrays, calls the C API for single-device execution, synchronizes via PJRT_Event_Await, and wraps output handles in Buffer structs. Execution options support device ordinal selection and per-input buffer donation hints via the ExecOption functional pattern. Also migrates remaining cuda.Ccall references to the centralized ccall wrapper in pjrt.go.
Contributor
Author
|
Content already in main |
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.
Phase 3 PJRT pipeline: execution support.