tutel icon indicating copy to clipboard operation
tutel copied to clipboard

where can I find the source code for specific mod file?

Open xiaof99 opened this issue 5 months ago • 3 comments

From my understanding, the mod file like deepseek_r1_sigmoid_top_k_routed_scaled_f32.mod is the kernel operation really carry out calculation like inference deepseek_r1. I wound like to know how is the mod file generated? And where can I find the source code. Seems like there is only one cpp file in this repository, and it did not contain all the code.

xiaof99 avatar Jul 05 '25 03:07 xiaof99

It is produced based on LLVM/NVVM, so there is not source code for them but PTX. Like Triton which is also based on LLVM, and I don't think they have kernel source code support.

ghostplant avatar Jul 05 '25 13:07 ghostplant

For instance, I found that in the docker image, there are two files:"/opt/deepseek-tutel-accel/ops.a100/fmoe_f16xf4_phase_1.mod" and "./deepseek-tutel-accel/ops.a100/fmoe_f16xf4_phase_2.mod". So I want to know how these files are generated. I know that they are generated by LLVM, but I am still wondering where can I find the source for this generation. I didn't find the location where the two phases are specified, and how can I control it to generate module for nvfp4.

xiaof99 avatar Jul 06 '25 15:07 xiaof99

Hi, the mod files are generated by a compiler project autort, which is an integration of different compilation backends. Even mod files seem to be the same format, they may be generated by different backends. For the cases you pointed, it is generated by a patched version of Triton with NVFP4 support, and I don't think they have the source code, but PTX code is possible. Does PTX code solve your requirement? What's your scenarios?

ghostplant avatar Jul 14 '25 09:07 ghostplant