Skip to content

Comments

Rewrite backend#488

Draft
jw1912 wants to merge 101 commits intomainfrom
backend-rewrite
Draft

Rewrite backend#488
jw1912 wants to merge 101 commits intomainfrom
backend-rewrite

Conversation

@jw1912
Copy link
Owner

@jw1912 jw1912 commented Nov 15, 2025

Main work is in making the compiler much more serious. This should make it overall easy to write any operation that does something involving a bunch of pointwise/reduction/broadcast/matmul using a simple builder pattern similar to the current GraphBuilder (and get something reasonably well optimised).

Stuff:

  • Core generic IR struct that other IRs use internally
  • TensorIR
    • Autograd
    • Core ops
      • Pointwise
      • Matmul
      • Broadcast/Reduce
      • Pad/Slice
      • Sparse matmul ops
      • Select ops
    • Optimisation passes
      • Autograd-level passes
      • Generic passes e.g. CSE, DCE, const-folding
      • ScalarConstant stuff
  • GPU backend
    • Runtime
      • CUDA bindings
      • ROCm (HIP) bindings
    • FusedPointwise compiling
      • PointwiseIR
      • Compile from a given FusedPointwise
      • Automatically vectorize loads/stores ~hacky
      • Ops
        • Pointwise
        • Broadcast
        • Pad/Slice
        • Select Pad/Slice
        • Sparse matmuls
    • Compiling TensorIR to executable function
      • Matmuls
      • Lower other ops to FusedPointwise individually
      • Fuse adjacent FusedPointwise where possible
        • Check if possible
        • Create fused op
        • Estimate cost
        • Perform highest reward fusion at a time - greedy
  • Integration with bullet_lib
    • With mock runtime
    • Sub in actual GPU runtime

@jw1912 jw1912 changed the title Backend rewrite (part 1?) Rewrite backend Feb 14, 2026
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.

1 participant