-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[DRAFT] Add AOT JIT+LTO capability #22390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
82c4bf1
First pass
vyasr 9832a01
Merge remote-tracking branch 'origin/main' into feat/nvjitlink_kernels
divyegala 77c483c
add jit+lto, tests pass
divyegala 1881bfa
remove udf reference
divyegala 5bfce79
run pre-commit
divyegala eb63608
Merge branch 'main' into feat/nvjitlink_kernels
divyegala 7a0c3f1
fix style check
divyegala 0292e26
Merge remote-tracking branch 'divye/feat/nvjitlink_kernels' into feat…
divyegala dcf0f20
Merge remote-tracking branch 'origin/main' into feat/nvjitlink_kernels
divyegala 22f1761
exclude nvjitlink from wheel install path
divyegala 551693f
remove double compilation
divyegala de922ce
Merge remote-tracking branch 'origin/main' into feat/nvjitlink_kernels
divyegala bab9125
make dispatcher its own fragment
divyegala 0caa15d
specialized dispatch and lto measurement
divyegala c9c5de0
bench options
divyegala fa91814
bench scripts
divyegala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # ============================================================================= | ||
| # cmake-format: off | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # cmake-format: on | ||
| # ============================================================================= | ||
|
|
||
| include_guard(GLOBAL) | ||
|
|
||
| # This function runs compute_matrix_product.py and stores the JSON matrix product in output_var. | ||
| function(compute_matrix_product output_var) | ||
| set(options) | ||
| set(one_value MATRIX_JSON_FILE MATRIX_JSON_STRING) | ||
| set(multi_value) | ||
|
|
||
| cmake_parse_arguments(_JIT_LTO "${options}" "${one_value}" "${multi_value}" ${ARGN}) | ||
|
|
||
| find_package(Python3 REQUIRED COMPONENTS Interpreter) | ||
|
|
||
| if(_JIT_LTO_MATRIX_JSON_FILE) | ||
| execute_process( | ||
| COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/compute_matrix_product.py" | ||
| "${_JIT_LTO_MATRIX_JSON_FILE}" # | ||
| OUTPUT_VARIABLE output COMMAND_ERROR_IS_FATAL ANY | ||
| ) | ||
| else() | ||
| execute_process( | ||
| COMMAND ${CMAKE_COMMAND} -E echo "${_JIT_LTO_MATRIX_JSON_STRING}" | ||
| COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/compute_matrix_product.py" | ||
| - | ||
| OUTPUT_VARIABLE output COMMAND_ERROR_IS_FATAL ANY | ||
| ) | ||
| endif() | ||
|
|
||
| set(${output_var} | ||
| "${output}" | ||
| PARENT_SCOPE | ||
| ) | ||
| endfunction() | ||
|
|
||
| # This function unpacks a JSON object into CMake variables in the caller scope. | ||
| function(populate_matrix_variables matrix_json_entry) | ||
| string(JSON len LENGTH "${matrix_json_entry}") | ||
| math(EXPR last "${len} - 1") | ||
|
|
||
| # cmake-lint: disable=C0103,E1120 | ||
| foreach(i RANGE "${last}") | ||
| string(JSON key MEMBER "${matrix_json_entry}" "${i}") | ||
| string(JSON value GET "${matrix_json_entry}" "${key}") | ||
| set(${key} | ||
| "${value}" | ||
| PARENT_SCOPE | ||
| ) | ||
| endforeach() | ||
| endfunction() | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Require exactly one matrix input source.
compute_matrix_product(...)silently prefersMATRIX_JSON_FILEwhen both inputs are set, and it falls through to the stdin path when neither is set. Both cases make configuration failures harder to diagnose and can generate the wrong matrix product.Suggested change
📝 Committable suggestion
🤖 Prompt for AI Agents