Skip to content

Conversation

@wujingyue
Copy link
Collaborator

It got accidentally reverted by #5328

It got accidentally reverted by #5328
@wujingyue
Copy link
Collaborator Author

!test

@wujingyue wujingyue requested review from mdavis36 and naoyam October 22, 2025 21:53
@github-actions
Copy link

Description

  • Fix signed-unsigned comparison in tensor shape inference

  • Enable Host IR JIT as runtime via EnableOption

  • Remove compile-time NVFUSER_HOST_IR_JIT flag

  • Update docs on Host IR JIT runtime configuration


Changes walkthrough 📝

Relevant files
Bug fix
1 files
jit.cpp
Fix signed-unsigned size comparison                                           
+2/-2     
Enhancement
4 files
options.cpp
Add HostIrJit to enable options                                                   
+1/-0     
fusion_kernel_runtime.cpp
Use EnableOption for Host IR backend selection                     
+15/-18 
options.h
Add HostIrJit enable option                                                           
+1/-0     
fusion_kernel_runtime.h
Conditionally include HostIrJit headers                                   
+9/-12   
Tests
2 files
test_host_ir_integration.cpp
Enable HostIrJit in integration tests                                       
+1/-0     
test_host_ir_jit.cpp
Initialize HostIrJit in test fixture                                         
+9/-4     
Configuration changes
2 files
utils.py
Remove build_with_host_ir_jit flag                                             
+0/-11   
CMakeLists.txt
Remove NVFUSER_HOST_IR_JIT option                                               
+35/-45 
Documentation
1 files
host_ir_jit.md
Update Host IR JIT configuration docs                                       
+11/-14 

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
⚡ Recommended focus areas for review

Possible Null Pointer Dereference

The code checks for hij_ and hie_ being non-null in isCompiled(), but does not validate their initialization before use in runWithInputs(), which could lead to a null pointer dereference if neither is initialized.

KernelArgumentHolder outputs;
if (hij_ != nullptr) {
  outputs = hij_->runWithInputs(args);
} else if (hie_ != nullptr) {
  outputs = hie_->runWithInputs(args);
} else {
  NVF_THROW("Neither Host IR JIT or Host IR Evaluator are initialized.");
}
Inconsistent State Handling

The getHostIrContainer() method assumes either hij_ or hie_ is valid based on EnableOption::HostIrJit, but does not handle the case where both could be null, potentially leading to undefined behavior.

if (isOptionEnabled(EnableOption::HostIrJit)) {
  NVF_ERROR(hij_ != nullptr, "Host IR JIT is not initialized");
  return hij_->container();
} else {
  NVF_ERROR(hie_ != nullptr, "Host IR Evaluator is not initialized");
  return hie_->container();
}
Use of Non-Standard Function

The use of std::ssize() may not be supported in all standard library implementations, potentially causing compilation issues on certain platforms.

NVF_ERROR_EQ(std::ssize(sizes), logical_ndims);
NVF_ERROR_EQ(std::ssize(strides), logical_ndims);

@wujingyue wujingyue merged commit 1ab9dc1 into main Oct 22, 2025
55 of 57 checks passed
@wujingyue wujingyue deleted the wjy/apply branch October 22, 2025 23:31
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.

3 participants