tlopex opened a new pull request, #19839:
URL: https://github.com/apache/tvm/pull/19839

   To solve #19682 , this pr reworks BYOC tutorial into two parts driven by one 
shared model: 
   
   - "How BYOC works": run a single conv2d+relu through the same 
FuseOpsByPattern -> MergeCompositeFunctions -> RunCodegen flow on both the 
example NPU (a stub, so check shape) and TensorRT (real, cross-checked against 
a CPU build), so the only thing that varies is the backend. 
partition_for_tensorrt is shown as the one-line wrapper for those two passes, 
with the bind_constants / stub-vs-real / shape-vs-value contrasts side by side. 
Add an FP16 example via the relax.ext.tensorrt.options pass config and a 
summary table; drop the redundant second NPU section.
   
   - "Deploying a PyTorch model with TensorRT": take a real torch.nn.Module 
through torch.export -> from_exported_program -> partition_for_tensorrt -> 
build for CUDA -> run, cross-checking the GPU output against PyTorch. This adds 
the end-to-end nn.Module example requested in #19682.
   
   This pr also fixes two stale references in the example NPU backend: the 
README and the runtime's \file docstring pointed at 
src/runtime/contrib/example_npu/ but the file lives under 
src/runtime/extra/contrib/example_npu/; and reword the README's "Memory 
constraint checking: Validates tensor sizes" bullet, since 
_check_npu_memory_constraints / _check_npu_quantization are explicit 
placeholders that return True.
   
   Validated end-to-end on a CUDA GPU with TensorRT 10: the example NPU, 
TensorRT, FP16, and PyTorch-deployment cells all run and match their references.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to