Provide host-level broadcast#129
Merged
Merged
Conversation
Implements `ct.Tiled(B) .= A .+ A .* B` syntax that leverages Julia's
broadcast fusion machinery and dispatches to cuTile kernels.
- `Tiled` wrapper type with `TiledCuArrayStyle` that wins over
`CuArrayStyle` and `DefaultArrayStyle`
- `materialize!` converts the fused `Broadcasted` tree: CuArrays become
TileArrays, style/axes are stripped
- Generic 1D/2D kernels recursively evaluate the `Broadcasted` tree on
tiles, using `broadcast(bc.f, args...)` for element-wise semantics
- Supports arbitrarily nested fused expressions (e.g. `A .+ A .* B`)
Type-constructor broadcasts (e.g. `BFloat16.(A)`) are not yet supported
due to `Type{T}` fields causing compilation issues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace separate 1D/2D broadcast kernels with a single @generated kernel that handles arbitrary dimensionality, matching the @fuse macro's bid-construction pattern for N>3 grid delinearization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
Is there a more robust way to do tile sizes? I did |
Replace the hardcoded 64×64 tile sizes with a greedy budget-based approach (4096 elements) that skips singleton dimensions and caps each tile dim at the array size. This fixes tiled broadcast for arrays with leading singleton or small dimensions (e.g. (1, 1024), (4, 1024)). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
I pushed something simple, maintaining a constant "element budget per tile", inspired by cuTile Python: https://github.com/NVIDIA/cutile-python/blob/7fb3407556e3d96759107d1bdaa01023101c44f0/samples/VectorAddition.py#L231-L236 |
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.
Implementing #121 (comment)