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

fix: add dll search path #982

Merged
merged 10 commits into from
Sep 12, 2024
Merged

fix: add dll search path #982

merged 10 commits into from
Sep 12, 2024

Conversation

vansangpfiev
Copy link
Contributor

@vansangpfiev vansangpfiev commented Aug 6, 2024

Describe Your Changes

Fixes Issues

Copy link
Contributor

@namchuai namchuai left a comment

Choose a reason for hiding this comment

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

✅ Great work!

} else if (e == "cortex.tensorrt-llm") {
return cortex_utils::kTensorrtLlmPath;
}
return cortex_utils::kLlamaLibPath;
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 208 and 212 - is it extraneous to have 208?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lines 208 and 212 - is it extraneous to have 208?

We fallback to default, will change the function to make it clearer.

// Unload the llamacpp dll directory then load the tensorrt-llm
// 2. If tensorrt-llm is loaded and new requested engine is llamacpp:
// Do nothing, llamacpp can re-use tensorrt-llm dependencies (need to be tested careful)
// 3. Add dll directory if met other conditions
Copy link
Contributor

Choose a reason for hiding this comment

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

Can I understand this in more detail:

  • We are always loading the dll directory of the latest used engine
  • Is this due to our decision to keep per-engine dependencies?
  • Are we able to load dlls on an as-needed basis, without removing the "older" engine dlls?

I imagine this will come up often in demos - we will demo:

cortex run llama3.1
cortex run llama3.1:tensorrt-llm
cortex run llama3.1:onnx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only load the engine's dll directory if engine is not loaded. In case of tensorrt-llm and llamacpp engine, it is a little bit tricky because the cuda dependencies may conflict so we need to remove before add the dll directory.

@dan-homebrew
Copy link
Contributor

dan-homebrew commented Sep 11, 2024

@vansangpfiev I do not have sufficient knowledge to be able to assess this PR, and have just approved it first to ensure you guys are not blocked.

I've left a couple of basic clarifying questions - if you don't mind

@vansangpfiev vansangpfiev merged commit 9fb5304 into dev Sep 12, 2024
4 checks passed
@vansangpfiev vansangpfiev deleted the fix/add-dll-search-path branch September 12, 2024 06:47
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.

feat: Set dll libraries search path for Cortex on Windows
3 participants