fix(pjrt): centralize internal/cuda import in pjrt.go#68
Closed
fix(pjrt): centralize internal/cuda import in pjrt.go#68
Conversation
Emit StableHLO MLIR text for structural operations: - MatMul -> stablehlo.dot_general with batching/contracting dims - Transpose -> stablehlo.transpose with permutation - Reshape -> stablehlo.reshape with shape validation - Concat -> stablehlo.concatenate along specified axis - Slice -> stablehlo.slice with starts/limits/strides - Gather -> stablehlo.gather with full dimension numbers All emitters use SSANamer and FormatTensorType from types.go and delegate shape inference to InferStructuralShape.
Implement Emitter struct that generates StableHLO MLIR text from SSA inputs, shapes, and dtypes. Covers binary ops (add, subtract, multiply, divide, power), unary ops (exponential, log, sine, cosine, tanh, sqrt, rsqrt, negate), and scalar ops (MulScalar, AddScalar, DivScalar) which emit constant + broadcast_in_dim + element-wise op. Includes EmitOp dispatch function for use by the program assembler.
…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.
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 2 PJRT pipeline: buffer management fixes.