Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
8ddd465
Working example dependency output buffering.
mdavis36 Dec 23, 2025
f84b2d0
Reporting basic status of CUDAToolkit & pybind11
mdavis36 Dec 23, 2025
a173f30
pretty colors.
mdavis36 Dec 23, 2025
7ccfce0
Alligning the report text.
mdavis36 Dec 23, 2025
4a16da4
On failure return report before exiting
mdavis36 Dec 23, 2025
2925d82
Remove duplicate install logic
mdavis36 Dec 23, 2025
dfa35bf
Setting up infrastructure for validating find_package dependencies an…
mdavis36 Dec 23, 2025
6f38b6b
Use helper functions to aid in readability of report function
mdavis36 Dec 23, 2025
7617ae3
generate a json dependency file with the results from CMake
mdavis36 Dec 26, 2025
afaaba3
dep python report.
mdavis36 Dec 26, 2025
1042a65
CMake execute python report script.
mdavis36 Dec 26, 2025
8b47e83
Remove CMake base reporting.
mdavis36 Dec 26, 2025
3b99e75
Creating prereq package.
mdavis36 Dec 26, 2025
53fa541
pulling in error/help messages from #5609
mdavis36 Dec 26, 2025
6c234bb
compiler, ninja & submodule reports.
mdavis36 Dec 26, 2025
90ee1ec
compiler, ninja and submodule checks.
mdavis36 Dec 26, 2025
564ab2c
simplify dep failure check.
mdavis36 Dec 26, 2025
ae99893
organize python req into modules.
mdavis36 Dec 26, 2025
3a890b6
Fail after CMake dump.
mdavis36 Dec 26, 2025
9ea74d9
re-order
mdavis36 Dec 26, 2025
108dabf
Move validation functions into their own cmake modules.
mdavis36 Dec 26, 2025
a0f5f12
Drop unused requirements vars.
mdavis36 Dec 26, 2025
e85dc11
Reducing logical overhead in repoting scripts with class structures.
mdavis36 Dec 26, 2025
dcc0032
Treat torch.cuda == cudatoolkit as a boolean req.
mdavis36 Dec 26, 2025
85967a9
Remove abstraction between python and CMake, just infer CMake variables
mdavis36 Dec 26, 2025
3be18cb
Simplify json output from CMake, let python do what it's good at.
mdavis36 Dec 26, 2025
3cb8098
explicit arguments for constructors.
mdavis36 Dec 27, 2025
0f2ad5a
Drop dependency name list.
mdavis36 Dec 27, 2025
529a52d
Drop help files, move function calls in req classes.
mdavis36 Dec 27, 2025
2744a3e
clean up ctor calls
mdavis36 Dec 27, 2025
75d257d
Compiler req uses direct cmake variables.
mdavis36 Dec 27, 2025
d3856cc
Use more explicit instantiations on the CMake side, remove ambiguity.
mdavis36 Dec 27, 2025
ad8051b
Remove unnecessary cmake vars in req file.
mdavis36 Dec 27, 2025
3c90d4f
PYTHON_EXECUTABLE -> Python_EXECUTABLE
mdavis36 Dec 27, 2025
36bab29
Move some generic compiler checks into handle.
mdavis36 Dec 27, 2025
480a59c
drop is constraint check
mdavis36 Dec 27, 2025
e244e02
Use set_dependency_status for compiler
mdavis36 Dec 27, 2025
a8e7a7f
drop indirection on location var.
mdavis36 Dec 27, 2025
584b46a
*_status -> *_report_status
mdavis36 Dec 27, 2025
c1de2b7
Add NVFUSER_ENABLE_DEPENDENCY_REPORT flag to disable reporting and de…
mdavis36 Dec 27, 2025
f153639
Update cmake/LogCapture.cmake header comment
mdavis36 Dec 27, 2025
1048742
Disable submodules, this needs further consideration.
mdavis36 Dec 27, 2025
eaad1ed
remove include.
mdavis36 Dec 27, 2025
e818dfe
user var for components.
mdavis36 Dec 27, 2025
7486630
user set_dependency_report_status in torch logic pre-checks.
mdavis36 Dec 27, 2025
7c5c597
Fix location report
mdavis36 Dec 27, 2025
4331d77
report colors & format.
mdavis36 Dec 27, 2025
8b286f1
doc update
mdavis36 Dec 27, 2025
adcac39
add platform info to report; remove unused functions in requirements …
mdavis36 Dec 27, 2025
f8f6677
clean up imports
mdavis36 Dec 27, 2025
59fe38a
check cmake variables are correct in comments.
mdavis36 Dec 27, 2025
11fb7ff
Remove unused log functions.
mdavis36 Dec 27, 2025
281adf9
var scope.
mdavis36 Dec 27, 2025
3918639
print help on non-success optional requirments too.
mdavis36 Dec 27, 2025
19da6b5
Ninja configuration instructions.
mdavis36 Dec 27, 2025
1b7fc18
Addressing greptile comments.
mdavis36 Jan 3, 2026
4353690
lintrunner changes.
mdavis36 Jan 3, 2026
476d48d
Add license headers
mdavis36 Jan 3, 2026
a2c9053
lint
mdavis36 Jan 3, 2026
dad9165
Set python min version to 3.10
mdavis36 Jan 12, 2026
d7d8114
Torch min version 2.9
mdavis36 Jan 12, 2026
5b0eaea
Disable color report w/ NVFUSER_BUILD_DISABLE_COLOR
mdavis36 Jan 12, 2026
8ab4291
Adding nvidia-matmul-heuristic to pip requirements list.
mdavis36 Jan 12, 2026
c8471a8
Handling NVMMH in cmake module and adding report module.
mdavis36 Jan 12, 2026
78c0836
Bump pybind11 to 3.0 min version (July 2025)
mdavis36 Jan 12, 2026
265ae58
Dependencies.cmake -> Submodules.cmake
mdavis36 Jan 13, 2026
3c2ff83
Move nvf_cutlass target logic into cutlass dir.
mdavis36 Jan 13, 2026
3b49e1e
Set NVFUSER_USE_CUTLASS to remove repeated version constraint.
mdavis36 Jan 13, 2026
f71693d
Move FlatBuffers and Cutlass version checking into Submodule cmake file.
mdavis36 Jan 13, 2026
c0bf39c
OPTIONAL=False for GNU/CLANG compilers.
mdavis36 Jan 13, 2026
ab039ae
Checking git submodules status
mdavis36 Jan 13, 2026
b02d591
mxfp8_scaled_mm
mdavis36 Jan 13, 2026
538ea1f
Merge branch 'main' into md/cmake-deps-5609-integration
mdavis36 Jan 13, 2026
1242d13
Use generic report function for Ninja status.
mdavis36 Jan 13, 2026
64cb6ce
handle_torch should not use return() calls.
mdavis36 Jan 13, 2026
6e16a2c
handle_git_submodules remove return() calls.
mdavis36 Jan 13, 2026
b30d079
Move torch dependent logic after we find torch.
mdavis36 Jan 13, 2026
2a3d9d8
Adding version to pybind11 in req.txt
mdavis36 Jan 13, 2026
ef58e8f
move submodule eval earlier in dep process.
mdavis36 Jan 13, 2026
43b8e39
spelling
mdavis36 Jan 13, 2026
d9842c0
handle_torch failed regex case.
mdavis36 Jan 13, 2026
5e6bca0
lint
mdavis36 Jan 13, 2026
d59e40c
remove references to specific versions in python reports
mdavis36 Jan 13, 2026
e978780
lint
mdavis36 Jan 13, 2026
94aac19
warning w/ non gcc/clang compilers.
mdavis36 Jan 13, 2026
047a6a6
fix hole in logic
mdavis36 Jan 13, 2026
64d84d3
Try a more specific delimiter string.
mdavis36 Jan 13, 2026
4a5588a
Clarify submodule specific output.
mdavis36 Jan 13, 2026
8f5f3f5
remove unnecessary status var assignments.
mdavis36 Jan 13, 2026
91a14f7
compiler option logic.
mdavis36 Jan 13, 2026
5169cdb
single regex check on submodule output.
mdavis36 Jan 13, 2026
0d88a52
Fix comment - we do return non 0 on failed reports.
mdavis36 Jan 13, 2026
b79420a
undefined var.
mdavis36 Jan 13, 2026
438d6ca
Testing GH clang build - disable CUTLASS always.
mdavis36 Jan 13, 2026
92dac9c
handle empty string case on bad regex.
mdavis36 Jan 13, 2026
93226ba
Throw warning & skip report if json fails to generate.
mdavis36 Jan 13, 2026
1c88d67
Rerport a reporducable command as part of warning when report script …
mdavis36 Jan 13, 2026
baaa3e0
NVFUSER_DISABLE_CUTLASS to explicitly disable cutlass even w/ cuda 12.8+
mdavis36 Jan 13, 2026
7846d48
Development.Module python target.
mdavis36 Jan 13, 2026
3661cbb
Merge branch 'main' into md/cmake-deps-5609-integration
mdavis36 Jan 13, 2026
b28004c
Conditionally pass CUTLASS_MAX_JOBS to cmake; Default MAX_JOBS to 2 s…
mdavis36 Jan 14, 2026
3af3644
Ensure output nvf_cutlass in CMAKE_BINARY_DIR
mdavis36 Jan 14, 2026
ea619a8
colors.WHITE -> colors.RESET for light themes.
mdavis36 Jan 14, 2026
d5c4d00
comment and abstract method attribute.
mdavis36 Jan 14, 2026
578a9f8
Default cutlass_max_jobs = None
mdavis36 Jan 14, 2026
3551f93
lint
mdavis36 Jan 14, 2026
2ff0a6c
Merge branch 'main' into md/cmake-deps-5609-integration
mdavis36 Jan 14, 2026
f39ef91
Check for missing delimiter.
mdavis36 Jan 14, 2026
ecaa34e
format.
mdavis36 Jan 14, 2026
de4d9bb
int | None
mdavis36 Jan 14, 2026
463493b
Add colorize helper function.
mdavis36 Jan 14, 2026
cd2c663
move validation
mdavis36 Jan 14, 2026
df06620
Merge branch 'main' into md/cmake-deps-5609-integration
mdavis36 Jan 15, 2026
55bce4e
Merge branch 'main' into md/cmake-deps-5609-integration
mdavis36 Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
272 changes: 86 additions & 186 deletions CMakeLists.txt

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions cmake/Dependencies.cmake

This file was deleted.

45 changes: 45 additions & 0 deletions cmake/DependencyRequirements.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

# ==============================================================================
# nvFuser Dependency Requirements
# ==============================================================================
#
# This file centralizes all dependency requirement metadata for nvFuser.
# Each requirement entry contains:
# - VERSION_MIN: Minimum version required (can be empty for "any version")
# - OPTIONAL: TRUE/FALSE (default FALSE)
# - COMPONENTS: Components required (for find_package, semicolon-separated)
#
# ==============================================================================

# Ninja
set(NVFUSER_REQUIREMENT_Ninja_OPTIONAL "TRUE")

# Compiler (GCC or Clang)
set(NVFUSER_REQUIREMENT_GNU_VERSION_MIN "13.1")
set(NVFUSER_REQUIREMENT_Clang_VERSION_MIN "19")

# Python
set(NVFUSER_REQUIREMENT_Python_VERSION_MIN "3.10")
set(NVFUSER_REQUIREMENT_Python_COMPONENTS "Interpreter;Development.Module")

# Torch
set(NVFUSER_REQUIREMENT_Torch_VERSION_MIN "2.9")

# pybind11
set(NVFUSER_REQUIREMENT_pybind11_VERSION_MIN "3.0")

# CUDAToolkit
set(NVFUSER_REQUIREMENT_CUDAToolkit_VERSION_MIN "12.6")
set(NVFUSER_REQUIREMENT_CUDAToolkit_COMPONENTS "Cupti;cuda_driver")

# LLVM
set(NVFUSER_REQUIREMENT_LLVM_VERSION_MIN "18.1")

# NVMMH
set(NVFUSER_REQUIREMENT_NVMMH_OPTIONAL "TRUE")

# Git Submodules (required for build)
# No version requirement - just checks if submodules are initialized
139 changes: 139 additions & 0 deletions cmake/DependencyUtilities.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

# ==============================================================================
# nvFuser Dependency Utilities
# ==============================================================================
#
# This file provides utilities for dependency status tracking and reporting.
# Dependency metadata is defined in DependencyRequirements.cmake
# Individual dependency handlers are in cmake/deps/
#
# ==============================================================================

# --------------------------
# Conditionally add REQUIRED to find_package calls
# --------------------------

# When dependency report is enabled, we don't use REQUIRED so we can collect
# all failures and show a comprehensive Python report.
# When disabled, we use REQUIRED for immediate failure with standard CMake errors.
if(NVFUSER_ENABLE_DEPENDENCY_REPORT)
set(MAYBE_REQUIRED "")
else()
set(MAYBE_REQUIRED "REQUIRED")
endif()

# --------------------------
# Status Tracking for JSON Export
# --------------------------

# Set dependency status based on found state and version check
macro(set_dependency_report_status name)
set(optional "${NVFUSER_REQUIREMENT_${name}_OPTIONAL}")

if(${name}_FOUND)
# Check version compatibility
set(min_version "${NVFUSER_REQUIREMENT_${name}_VERSION_MIN}")
set(version "${${name}_VERSION}")

if(DEFINED min_version AND NOT "${min_version}" STREQUAL "")
if("${version}" VERSION_GREATER_EQUAL "${min_version}")
set(NVFUSER_REQUIREMENT_${name}_STATUS "SUCCESS")
else()
set(NVFUSER_REQUIREMENT_${name}_STATUS "INCOMPATIBLE")
# Mark dependencies as failed if this is a required dependency
if(NOT optional)
set(NVFUSER_DEPENDENCIES_OK FALSE)
endif()
endif()
else()
set(NVFUSER_REQUIREMENT_${name}_STATUS "SUCCESS")
endif()
else()
set(NVFUSER_REQUIREMENT_${name}_STATUS "NOT_FOUND")
# Mark dependencies as failed if this is a required dependency
if(NOT optional)
set(NVFUSER_DEPENDENCIES_OK FALSE)
endif()
endif()
endmacro()

# --------------------------
# Python Export for Dependency Reporting
# --------------------------

function(export_dependency_json output_file)
# Get all CMake variables
get_cmake_property(all_vars VARIABLES)

# Write JSON file with flat variable dict
file(WRITE "${output_file}" "{\n")
file(APPEND "${output_file}" " \"cmake_vars\": {\n")

# Export all variables (sorted for consistency)
list(SORT all_vars)
list(LENGTH all_vars var_count)
set(var_index 0)
foreach(var ${all_vars})
set(value "${${var}}")
# Escape for JSON strings
string(REPLACE "\\" "\\\\" value "${value}")
string(REPLACE "\"" "\\\"" value "${value}")
string(REPLACE "\n" "\\n" value "${value}")
string(REPLACE "\t" "\\t" value "${value}")
string(REPLACE "\r" "\\r" value "${value}")

# Add comma if not last item
math(EXPR var_index "${var_index} + 1")
if(var_index LESS var_count)
file(APPEND "${output_file}" " \"${var}\": \"${value}\",\n")
else()
file(APPEND "${output_file}" " \"${var}\": \"${value}\"\n")
endif()
endforeach()

file(APPEND "${output_file}" " }\n")
file(APPEND "${output_file}" "}\n")
endfunction()

# --------------------------
# Report Dependencies (Python-based with fallback)
# --------------------------

macro(report_dependencies)
# Export dependency data to JSON with error handling
set(json_file "${CMAKE_BINARY_DIR}/nvfuser_dependencies.json")
export_dependency_json("${json_file}")
if(NOT EXISTS "${json_file}")
message(WARNING "Failed to export dependency data to ${json_file} - skipping enhanced dependency report")
else()

# Try to use Python script for enhanced reporting
set(python_script "${CMAKE_SOURCE_DIR}/python/tools/check_dependencies.py")

if(NOT EXISTS "${python_script}")
message(WARNING "Python reporting script not found: ${python_script}")
elseif(NOT DEFINED Python_EXECUTABLE OR NOT Python_FOUND)
message(WARNING "Python is not available - skipping enhanced dependency report")
else()
# Run Python reporting script
execute_process(
COMMAND ${Python_EXECUTABLE} ${python_script} ${json_file}
RESULT_VARIABLE python_result
OUTPUT_VARIABLE python_output
ERROR_VARIABLE python_error
)

if(NOT python_result EQUAL 0)
message(WARNING "Python reporting failed (${python_result}): ${python_error} To reproduce: ${Python_EXECUTABLE} ${python_script} ${json_file}")
else()
# Display Python output
message("${python_output}")
endif()
endif()

endif()

endmacro()
10 changes: 0 additions & 10 deletions cmake/FlatBuffers.cmake

This file was deleted.

90 changes: 90 additions & 0 deletions cmake/LogCapture.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

# ==============================================================================
# nvFuser Log Capture Utilities
# ==============================================================================

# Global switch to control logging behavior
set(LOG_CAPTURE_MODE FALSE CACHE INTERNAL "")
set(GLOBAL_LOG_BUFFER "" CACHE INTERNAL "")

# 1. Override message() ONCE for the whole project.
# This acts as a "Gatekeeper" for BOTH capture and suppression.
function(message)
# Handle empty lines
if(NOT ARGV)
if(LOG_CAPTURE_MODE)
# Store empty line marker when capturing
set_property(GLOBAL APPEND PROPERTY GLOBAL_LOG_BUFFER "EMPTY_LINE")
elseif(NOT SUPPRESS_MESSAGE_OUTPUT)
# Print empty line when not suppressing
_message("")
endif()
return()
endif()

# Get the message type (STATUS, WARNING, FATAL_ERROR, etc.)
list(GET ARGV 0 type)

# Pass through FATAL_ERROR and SEND_ERROR immediately (Fail Fast)
if(type STREQUAL "FATAL_ERROR" OR type STREQUAL "SEND_ERROR")
_message(${ARGV})
return()
endif()

# Logic: Capture, Suppress, or Print?
if(LOG_CAPTURE_MODE)
# CAPTURE MODE: Store type and content separately
# Remove the type from ARGV to get just the content
set(_argv_copy ${ARGV})
list(REMOVE_AT _argv_copy 0)
string(JOIN " " msg_content ${_argv_copy})
# Use a delimiter (<<<DELIM>>>) to separate type from content
set_property(GLOBAL APPEND PROPERTY GLOBAL_LOG_BUFFER "${type}<<<DELIM>>>${msg_content}")
elseif(SUPPRESS_MESSAGE_OUTPUT)
# SUPPRESS MODE: Block all non-critical messages (already handled errors above)
# Do nothing
else()
# NORMAL MODE: Pass through to internal CMake message
_message(${ARGV})
endif()
endfunction()

# 2. Macros to control the switch
macro(start_capture)
set(LOG_CAPTURE_MODE TRUE)
set_property(GLOBAL PROPERTY GLOBAL_LOG_BUFFER "") # Clear buffer
endmacro()

macro(stop_capture target_var)
set(LOG_CAPTURE_MODE FALSE)
# Move global buffer to user variable
get_property(_logs GLOBAL PROPERTY GLOBAL_LOG_BUFFER)
set(${target_var} "${_logs}")
endmacro()

# 3. Helper to print the logs later
function(dump_captured_logs log_list)
foreach(entry ${log_list})
if("${entry}" STREQUAL "EMPTY_LINE")
_message("")
else()
# Split "TYPE|||CONTENT"
# Split "TYPE<<<DELIM>>>CONTENT"
string(FIND "${entry}" "<<<DELIM>>>" pos)
if(pos EQUAL -1)
message(WARNING "Log entry missing delimiter: ${entry}")
continue()
endif()
string(SUBSTRING "${entry}" 0 ${pos} type)
math(EXPR content_start "${pos} + 11")
string(SUBSTRING "${entry}" ${content_start} -1 content)

# Print using the original type (STATUS, WARNING, etc.)
# This preserves color and formatting!
_message(${type} "${content}")
endif()
endforeach()
endfunction()
Loading