-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support native code binary representation for XPU backend (#2148)
Adds a new command line flag, `TRITON_XPU_GEN_NATIVE_CODE`, which is used to enable generating native device code and storing it in the `.spv` file instead of spirv. To avoid having to access the sycl runtime inside the compiler, we use `ocloc` (just like the nvidia backend uses `ptxas` to generate `cubin` from `ptx`. But, because there is no textual representation of `spirv`, we do not store the spirv. Originally, I had changed the file extension but decided to stick with `spv` for now while we evaluate if/when we want to enable this functionality. In my testing this makes very little difference in back-to-back runs because the driver caches the native code. But this feature was requested for Inductor AOT mode where the model is exported into a self-contained library. ``` spirv: compile eval time 0: 10.648161754 compile eval time 1: 0.013945419 compile eval time 2: 0.012984403 compile eval time 3: 0.012636915 compile eval time 4: 0.0126077 compile eval time 5: 0.012621725 compile eval time 6: 0.012668987 compile eval time 7: 0.012654901 compile eval time 8: 0.01264564 compile eval time 9: 0.013606956 generated native code: compile eval time 0: 15.920665989 compile eval time 1: 0.013856625 compile eval time 2: 0.012849391 compile eval time 3: 0.01316768 compile eval time 4: 0.012814131 compile eval time 5: 0.012739703 compile eval time 6: 0.012831038 compile eval time 7: 0.012756367 compile eval time 8: 0.012842068 compile eval time 9: 0.013376863 ``` Close #1792
- Loading branch information
Showing
4 changed files
with
139 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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 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 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 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