Skip to content

Comments

Set autoincrementing index in FusionExecutor::compileRtc#1162

Draft
jacobhinkle wants to merge 5 commits intomainfrom
compilertc_index_increment
Draft

Set autoincrementing index in FusionExecutor::compileRtc#1162
jacobhinkle wants to merge 5 commits intomainfrom
compilertc_index_increment

Conversation

@jacobhinkle
Copy link
Collaborator

compileRtc is used only in a few tests (seven currently) to test basic compilation functionality. Currently, calling compileRtc does not use fusion_id_counter_, and does not set fusion_id_ until after calling getStructuredCode. This means that if we print the kernel or compiled PTX, we get a file named like __tmp_kernel-1.{cu,ptx}. Here -1 is the default value of fusion_id_. This has caused a problem in codegen diff, which expects us to not overwrite these files, and for them to follow a somewhat regular naming scheme.

This change simply sets the ID before getStructuredCode using fusion_id_counter_ to mimic what happens in compileFusion.

compileRtc is used only in a few tests (seven currently) to test basic
compilation functionality. Currently, calling compileRtc does not use
fusion_id_counter_, and does not set fusion_id_ until after calling
getStructuredCode. This means that if we print the kernel or compiled
PTX, we get a file named like `__tmp_kernel-1.{cu,ptx}`. Here -1 is the
default value of `fusion_id_`. This has caused a problem in codegen
diff, which expects us to not overwrite these files, and for them to
follow a somewhat regular naming scheme.

This change simply sets the ID before `getStructuredCode` using
`fusion_id_counter_` to mimic what happens in `compileFusion`.
@jacobhinkle jacobhinkle requested a review from xwang233 October 26, 2023 23:58
@jacobhinkle
Copy link
Collaborator Author

!build

@xwang233 xwang233 requested a review from naoyam October 27, 2023 00:01
@jacobhinkle
Copy link
Collaborator Author

!build --diff

@jacobhinkle
Copy link
Collaborator Author

!build --diff

@jacobhinkle
Copy link
Collaborator Author

!build --diff

@jacobhinkle jacobhinkle requested review from rdspring1 and xwang233 and removed request for xwang233 November 18, 2023 12:50
@jacobhinkle
Copy link
Collaborator Author

jacobhinkle commented Nov 18, 2023

With the latest change in #1330 we no longer have stuff like __tmp_kernel-1.cu, but we instead get wraparound, so you will find __tmp_kernel_32195.cu instead when running the binary tests. They actually autoincrement from there just fine, but it's a bit strange.

@jacobhinkle jacobhinkle marked this pull request as draft November 18, 2023 13:02
@naoyam
Copy link
Collaborator

naoyam commented Jul 23, 2025

@jacobhinkle Is this still relevant?

@jacobhinkle
Copy link
Collaborator Author

@jacobhinkle Is this still relevant?

It is not. I need to do some spring cleaning on all of my old draft PRs

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.

2 participants