Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the compile parameter in baseline benchmarks to executor #3350

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

Priya2698
Copy link
Collaborator

@Priya2698 Priya2698 commented Nov 5, 2024

This PR is the first step in adding thunder.jit benchmarks.
The major change is modifying the compile parameter to executor with values eager, torchcompile, thunder. This PR does not introduce any new thunder benchmarks (to be done in next PR).

CC: @xwang233 for dashboard changes.

Issue: #2718

Comment on lines +115 to +118
benchmark_fn = {
"eager": bcast_add_fwd_fn,
"torchcompile": torch.compile(bcast_add_fwd_fn),
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I'd avoid using pure strings as much as possible because it'd be difficult to debug when things don't work as intended. For example, I suppose you won't get any error even if you typed "torch.compile".

Not a request to change anything, but just my two cents.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we 've seen a similar typo err where device was typed as degvice

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I considered using enums, but the misspelling can cause errors with that too.
Here, if torchcompile is spelled as torch.compile, in later lines, benchmark_fn[executor] will error out. So combined with the assertion that @liqiangxl suggested in the below comment for get_test_executor, we should be able to catch any spelling errors.

Please let me know if you have any suggestions which may be more error-proof.

def get_test_executor(item) -> str | None:
if hasattr(item, "callspec") and "executor" in item.callspec.params:
return item.callspec.params["executor"]
return None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest adding a check ensure executor is one of "eager", "torchcompile", "thunder" to avoid typo, e.g. "torchcompile" -> "torch.compile"

@liqiangxl
Copy link
Collaborator

LGTM, can put a note about the design to the original issue?

Copy link
Collaborator

@naoyam naoyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Priya2698
Copy link
Collaborator Author

!build

@Priya2698 Priya2698 merged commit 96d64b6 into main Nov 8, 2024
12 of 13 checks passed
@Priya2698 Priya2698 deleted the pm/compile_to_executor branch November 8, 2024 04:19
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