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

Add eager flag and set compile to be always true #734

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ajtejankar
Copy link
Contributor

Adds a new flag to the launcher called --eager that allows users to disable CUDA graph compilation which is enabled by default. Also, sets --compile to always be true. Finally, tested that compile works with following list of models, and added a property called supports_cuda_graph_compilation that individual models can set to disable compilation.

  • microsoft/phi-4
  • mistralai/Mistral-7B-Instruct-v0.2
  • meta-llama/Llama-3.2-11B-Vision-Instruct
  • meta-llama/Llama-3.1-8B-Instruct
  • Qwen/Qwen2.5-7B-Instruct
  • upstage/SOLAR-10.7B-v1.0
  • ibm-granite/granite-3.1-8b-instruct

@ajtejankar ajtejankar requested a review from tgaddair January 9, 2025 17:33
#[clap(long, env, value_enum)]
/// Only use either `--compile` or `--eager`. Using both at the same time will
/// result in an error.
#[clap(default_value = "true", long, env, value_enum)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this defaults to true here, will this raise an error if the user specifies --eager without setting anything for compile?

Typically we would change the type of compile here to Option[bool] so we can distinguish between explicitly specified args vs unspecified.

@@ -228,6 +228,10 @@ def check_initialized(self):
f"found uninitialized parameters in model {self.__class__.__name__}: {uninitialized_parameters}"
)

@property
def supports_cuda_graph_compilation(self) -> bool:
return True
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to set this to False for some models?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least with the limited models I tested, compile worked so we don't set this property to False for any model, but we may want to in the future. Not needed at the moment so happy to get rid of it.

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