Repository navigation
[rocjitsu] Add fixed-profile gfx1250 B0-to-A0 DBT library - #9062
Merged
Merged
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new fixed-profile RocJITsu shared library that performs gfx1250 B0→A0 code-object translation with a narrow dependency surface, aiming to dramatically reduce the shipped .so size while providing a stable C API and focused end-to-end tests.
Changes:
- Introduces
rocjitsu_gfx1250_b0_to_a0shared library with a revision-fixed C API and Linux version-script export pinning. - Adds kernel fixture plumbing and a new gtest that exercises argument validation and (optionally) translation of a real gfx1250 code object.
- Installs the new shared library and exposes the new header via the existing
rocjitsu/code/api.humbrella.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| emulation/rocjitsu/tests/kernels/CMakeLists.txt | Adds a gfx1250 raw-HSACO fixture target and install rule for DBT testing. |
| emulation/rocjitsu/tests/dbt/gfx1250_b0_to_a0_library_test.cpp | New end-to-end tests for the fixed-profile B0→A0 translation API. |
| emulation/rocjitsu/tests/CMakeLists.txt | Wires the new gtest executable and optional fixture dependency under Linux. |
| emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/code/dbt/gfx1250_b0_to_a0.exports | Linux linker version-script restricting exports to the two public C functions. |
| emulation/rocjitsu/lib/rocjitsu/src/rocjitsu/code/dbt/gfx1250_b0_to_a0_library.cpp | Implements the narrow decoder factory and the translate/free C API. |
| emulation/rocjitsu/lib/rocjitsu/include/rocjitsu/code/rj_gfx1250_b0_to_a0.h | Adds the public C header for the fixed-profile translation API. |
| emulation/rocjitsu/lib/rocjitsu/include/rocjitsu/code/api.h | Exposes the new header from the public code API umbrella. |
| emulation/rocjitsu/lib/rocjitsu/CMakeLists.txt | Adds the new shared library target and Linux link options for symbol control. |
| emulation/rocjitsu/CMakeLists.txt | Installs the new shared library alongside existing RocJITsu artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kuhar
force-pushed
the
users/kuhar/dbt-b0-a0-library
branch
from
July 23, 2026 00:17
b37a94f to
f11a184
Compare
## Motivation The gfx1250 B0-to-A0 translation added in #8947 is consumed at load time, but the existing `librocjitsu_hooks.so` image also carries every AMDGPU ISA model, simulator execution semantics, the VM, and the HSA tools integration. That makes the stripped hooks library 50,447,272 bytes and gives a fixed gfx1250 translator a much broader dependency surface than it needs. This PR adds a dedicated Linux shared library for that fixed translation profile. It uses the model-only ISA layering from #8933, links only the generic DBT base and the gfx1250 model, and produces a stripped image below 5 MB. ## Technical Details - Add Linux-only `librocjitsu_gfx1250_b0_to_a0.so`, composed from `rocjitsu_dbt_internal`, `rocjitsu_isa_gfx1250_model`, and the header-only SimDojo interface. It does not link the simulator implementation, VM, ISA registry, or non-gfx1250 decoders. - Add a revision-fixed C API that accepts a standalone AMDGPU ELF, always translates gfx1250 B0 to gfx1250 A0, and returns caller-owned output storage. - Export only `rj_gfx1250_b0_to_a0_translate` and `rj_gfx1250_b0_to_a0_free`; hide archive internals with the existing hidden visibility policy plus a Linux version script. - Install the library and public header with the normal Linux RocJITsu artifacts. - Add a real raw gfx1250 code-object fixture and end-to-end translation test. This PR provides the narrow library and loader-facing ABI. It does not change the separate COMGR HotSwap shim or selector; that integration must load this SONAME and resolve the two exported RocJITsu entry points. ## Issue Tracking Related: #8939 ## Test Plan - Build `rocjitsu_gfx1250_b0_to_a0` and its raw gfx1250 fixture. - Run the model-only and fixed-profile library tests. - Run the focused gfx1250 B0-to-A0 DBT regression suite. - Compile the public header from a strict C11 client. - Inspect the library's symbols and dynamic dependencies, then measure its stripped size. - Run the RocJITsu pre-commit checks. ## Test Result - Model-only and fixed-profile library tests: 4/4 passed. - Focused gfx1250 B0-to-A0 DBT tests: 42/42 passed. - Real raw gfx1250 code-object translation: passed. - Strict C11 public-header client: passed. - Manual binary audit: exactly two public exports; only standard C/C++ runtime shared-library dependencies; no simulator, VM, execution, registry, COMGR, HSA runtime, or non-gfx1250 ISA implementation symbols. - Stripped library size: 4,522,664 bytes, below the 5,000,000-byte limit and 11.15x smaller than the stripped 50,447,272-byte hooks library. - Pre-commit checks: passed. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
kuhar
force-pushed
the
users/kuhar/dbt-b0-a0-library
branch
from
July 23, 2026 00:19
f11a184 to
34beee3
Compare
atgutier
approved these changes
Jul 23, 2026
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.
Motivation
This PR adds a dedicated shared library for that fixed translation profile for gfx1250. It uses the model-only ISA layering from #8933, links only the generic DBT base and the gfx1250 model.
This reduces the .so size from >50MB to <5MB.
Technical Details
librocjitsu_gfx1250_b0_to_a0.so, composed fromrocjitsu_dbt_internal,rocjitsu_isa_gfx1250_model, and the header-only SimDojo interface. It does not link the simulator implementation, VM, ISA registry, or non-gfx1250 decoders.rj_gfx1250_b0_to_a0_translateandrj_gfx1250_b0_to_a0_free; hide archive internals with the existing hidden visibility policy plus a Linux version script.Issue Tracking
N/A
Test Plan
ctest + check symbols with
nmTest Result
OK
Submission Checklist