Skip to content

Initial Implementation of TGR definition and HLO->TGR compilation#222

Closed
P-bibs wants to merge 15 commits intomainfrom
pb/hlr
Closed

Initial Implementation of TGR definition and HLO->TGR compilation#222
P-bibs wants to merge 15 commits intomainfrom
pb/hlr

Conversation

@P-bibs
Copy link
Collaborator

@P-bibs P-bibs commented Jul 15, 2025

This is a continuation of the recent PR that was merged into this branch and defined TGR (see the first commit on this branch, dc2a7c8). Now that I've ironed out bugs surrounding how to handle scalar values and broadcasting, it is ready to be merged into main as we prepare to start compiling TGR into KLR

Changes since previous PR

  • Use TensorLib's arrayScalar representation for scalar values
  • Adjust TGR's representation of broadcasting to be simpler than HLO
  • Add support for more constant tensor types, including large hex-encoded integer tensors and boolean tensors
  • Adjust HLO->TGR compilation to generate fresh symbols to prevent name collisions

To test, download the attached file and then run

lake exe klr hlo-to-tgr attention-opt.txt -o main.dot

attention-opt.txt

@P-bibs P-bibs changed the title Initial Implementation of HLR definition and HLO->HLR compilation Initial Implementation of TGR definition and HLO->TGR compilation Jul 16, 2025
@P-bibs P-bibs marked this pull request as ready for review July 18, 2025 19:22
@P-bibs
Copy link
Collaborator Author

P-bibs commented Jul 18, 2025

This is now ready for review, even though the CI is failing because we need a PR in TensorLib to be merged first leanprover/TensorLib#85

Paul Biberstein and others added 14 commits July 23, 2025 14:31
* Add Sherloc as a dependency
* Add the definition of the HLR AST
* Add functionality to compile HLO to HLR
* Add functionality to export an HLR program as a graph
* Add functionality to export an HLR program as a Python program with equivalent semantics
* Add a CLI command to compile an HLO program to HLR
@govereau
Copy link
Collaborator

govereau commented Sep 4, 2025

I think this PR is no longer relevant.

@P-bibs P-bibs closed this Sep 4, 2025
@P-bibs P-bibs deleted the pb/hlr branch September 4, 2025 17:24
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.

2 participants