-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: check Cuda version for Tensorrt-llm models
- Loading branch information
1 parent
a543315
commit 5859371
Showing
6 changed files
with
59 additions
and
7 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
export const checkModelCompatibility = (modelId: string) => { | ||
import { MIN_CUDA_VERSION } from "@/infrastructure/constants/cortex"; | ||
import { getCudaVersion } from "./cuda"; | ||
|
||
export const checkModelCompatibility = async (modelId: string) => { | ||
if (modelId.includes('onnx') && process.platform !== 'win32') { | ||
console.error('The ONNX engine does not support this OS yet.'); | ||
process.exit(1); | ||
} | ||
|
||
if (modelId.includes('tensorrt-llm') && process.platform === 'darwin') { | ||
console.error('Tensorrt-LLM models are not supported on this OS'); | ||
process.exit(1); | ||
if (modelId.includes('tensorrt-llm') ) { | ||
if(process.platform === 'darwin'){ | ||
console.error('Tensorrt-LLM models are not supported on this OS'); | ||
process.exit(1); | ||
} | ||
|
||
try{ | ||
const version = await getCudaVersion(); | ||
const [currentMajor, currentMinor] = version.split('.').map(Number); | ||
const [requiredMajor, requiredMinor] = MIN_CUDA_VERSION.split('.').map(Number); | ||
const isMatchRequired = currentMajor > requiredMajor || (currentMajor === requiredMajor && currentMinor >= requiredMinor); | ||
if (!isMatchRequired) { | ||
console.error(`CUDA version ${version} is not compatible with TensorRT-LLM models. Required version: ${MIN_CUDA_VERSION}`); | ||
process.exit(1); | ||
} | ||
} catch (e) { | ||
console.error(e.message ?? e); | ||
process.exit(1); | ||
} | ||
|
||
} | ||
}; |