Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit eec21b5

Browse files
authored
chore: remove references to ONNX and TRT-LLM (#1961)
1 parent 76b1983 commit eec21b5

File tree

5 files changed

+14
-75
lines changed

5 files changed

+14
-75
lines changed

engine/cli/utils/download_progress.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ namespace {
1717
std::string Repo2Engine(const std::string& r) {
1818
if (r == kLlamaRepo) {
1919
return kLlamaEngine;
20-
} else if (r == kOnnxRepo) {
21-
return kOnnxEngine;
22-
} else if (r == kTrtLlmRepo) {
23-
return kTrtLlmEngine;
2420
}
2521
return r;
2622
};

engine/controllers/engines.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ namespace {
1313
std::string NormalizeEngine(const std::string& engine) {
1414
if (engine == kLlamaEngine) {
1515
return kLlamaRepo;
16-
} else if (engine == kOnnxEngine) {
17-
return kOnnxRepo;
18-
} else if (engine == kTrtLlmEngine) {
19-
return kTrtLlmRepo;
2016
}
2117
return engine;
2218
};

engine/controllers/models.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,7 @@ void Models::GetModel(const HttpRequestPtr& req,
297297
fs::path(model_entry.value().path_to_model_yaml))
298298
.string());
299299
auto model_config = yaml_handler.GetModelConfig();
300-
if (model_config.engine == kOnnxEngine ||
301-
model_config.engine == kLlamaEngine ||
302-
model_config.engine == kTrtLlmEngine) {
300+
if (model_config.engine == kLlamaEngine) {
303301
auto ret = model_config.ToJsonString();
304302
auto resp = cortex_utils::CreateCortexHttpTextAsJsonResponse(ret);
305303
resp->setStatusCode(drogon::k200OK);
@@ -379,9 +377,7 @@ void Models::UpdateModel(const HttpRequestPtr& req,
379377
yaml_handler.ModelConfigFromFile(yaml_fp.string());
380378
config::ModelConfig model_config = yaml_handler.GetModelConfig();
381379
std::string message;
382-
if (model_config.engine == kOnnxEngine ||
383-
model_config.engine == kLlamaEngine ||
384-
model_config.engine == kTrtLlmEngine) {
380+
if (model_config.engine == kLlamaEngine) {
385381
model_config.FromJson(json_body);
386382
yaml_handler.UpdateModelConfig(model_config);
387383
yaml_handler.WriteYamlFile(yaml_fp.string());

engine/services/engine_service.cc

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,52 +27,37 @@ namespace {
2727
std::string GetSuitableCudaVersion(const std::string& engine,
2828
const std::string& cuda_driver_version) {
2929
auto suitable_toolkit_version = "";
30-
if (engine == kTrtLlmRepo || engine == kTrtLlmEngine) {
31-
// for tensorrt-llm, we need to download cuda toolkit v12.4
32-
suitable_toolkit_version = "12.4";
33-
} else {
34-
// llamacpp
35-
auto cuda_driver_semver =
36-
semantic_version_utils::SplitVersion(cuda_driver_version);
37-
if (cuda_driver_semver.major == 11) {
38-
suitable_toolkit_version = "11.7";
39-
} else if (cuda_driver_semver.major == 12) {
40-
suitable_toolkit_version = "12.0";
41-
}
30+
31+
// llamacpp
32+
auto cuda_driver_semver =
33+
semantic_version_utils::SplitVersion(cuda_driver_version);
34+
if (cuda_driver_semver.major == 11) {
35+
suitable_toolkit_version = "11.7";
36+
} else if (cuda_driver_semver.major == 12) {
37+
suitable_toolkit_version = "12.0";
4238
}
39+
4340
return suitable_toolkit_version;
4441
}
4542

4643
// Need to change this after we rename repositories
4744
std::string NormalizeEngine(const std::string& engine) {
4845
if (engine == kLlamaEngine) {
4946
return kLlamaRepo;
50-
} else if (engine == kOnnxEngine) {
51-
return kOnnxRepo;
52-
} else if (engine == kTrtLlmEngine) {
53-
return kTrtLlmRepo;
5447
}
5548
return engine;
5649
};
5750

5851
std::string Repo2Engine(const std::string& r) {
5952
if (r == kLlamaRepo) {
6053
return kLlamaEngine;
61-
} else if (r == kOnnxRepo) {
62-
return kOnnxEngine;
63-
} else if (r == kTrtLlmRepo) {
64-
return kTrtLlmEngine;
6554
}
6655
return r;
6756
};
6857

6958
std::string GetEnginePath(std::string_view e) {
7059
if (e == kLlamaRepo) {
7160
return kLlamaLibPath;
72-
} else if (e == kOnnxRepo) {
73-
return kOnnxLibPath;
74-
} else if (e == kTrtLlmRepo) {
75-
return kTensorrtLlmPath;
7661
}
7762
return kLlamaLibPath;
7863
};
@@ -85,13 +70,6 @@ cpp::result<void, std::string> EngineService::InstallEngineAsync(
8570
CTL_INF("InstallEngineAsync: " << ne << ", " << version << ", "
8671
<< variant_name.value_or(""));
8772
auto os = hw_inf_.sys_inf->os;
88-
if (os == kMacOs && (ne == kOnnxRepo || ne == kTrtLlmRepo)) {
89-
return cpp::fail("Engine " + ne + " is not supported on macOS");
90-
}
91-
92-
if (os == kLinuxOs && ne == kOnnxRepo) {
93-
return cpp::fail("Engine " + ne + " is not supported on Linux");
94-
}
9573

9674
auto result = DownloadEngine(ne, version, variant_name);
9775
if (result.has_error()) {
@@ -386,9 +364,8 @@ cpp::result<void, std::string> EngineService::DownloadEngine(
386364

387365
cpp::result<bool, std::string> EngineService::DownloadCuda(
388366
const std::string& engine, bool async) {
389-
if (hw_inf_.sys_inf->os == "mac" || engine == kOnnxRepo ||
390-
engine == kOnnxEngine) {
391-
// mac and onnx engine does not require cuda toolkit
367+
if (hw_inf_.sys_inf->os == "mac") {
368+
// mac does not require cuda toolkit
392369
return true;
393370
}
394371

@@ -453,13 +430,7 @@ cpp::result<bool, std::string> EngineService::DownloadCuda(
453430
std::string EngineService::GetMatchedVariant(
454431
const std::string& engine, const std::vector<std::string>& variants) {
455432
std::string matched_variant;
456-
if (engine == kTrtLlmRepo || engine == kTrtLlmEngine) {
457-
matched_variant = engine_matcher_utils::ValidateTensorrtLlm(
458-
variants, hw_inf_.sys_inf->os, hw_inf_.cuda_driver_version);
459-
} else if (engine == kOnnxRepo || engine == kOnnxEngine) {
460-
matched_variant = engine_matcher_utils::ValidateOnnx(
461-
variants, hw_inf_.sys_inf->os, hw_inf_.sys_inf->arch);
462-
} else if (engine == kLlamaRepo || engine == kLlamaEngine) {
433+
if (engine == kLlamaRepo || engine == kLlamaEngine) {
463434
auto suitable_avx =
464435
engine_matcher_utils::GetSuitableAvxVariant(hw_inf_.cpu_inf);
465436
matched_variant = engine_matcher_utils::Validate(
@@ -638,13 +609,6 @@ cpp::result<std::vector<EngineVariantResponse>, std::string>
638609
EngineService::GetInstalledEngineVariants(const std::string& engine) const {
639610
auto ne = NormalizeEngine(engine);
640611
auto os = hw_inf_.sys_inf->os;
641-
if (os == kMacOs && (ne == kOnnxRepo || ne == kTrtLlmRepo)) {
642-
return cpp::fail("Engine " + engine + " is not supported on macOS");
643-
}
644-
645-
if (os == kLinuxOs && ne == kOnnxRepo) {
646-
return cpp::fail("Engine " + engine + " is not supported on Linux");
647-
}
648612

649613
auto engines_variants_dir =
650614
file_manager_utils::GetEnginesContainerPath() / ne;
@@ -954,13 +918,7 @@ cpp::result<bool, std::string> EngineService::IsEngineReady(
954918
}
955919

956920
auto os = hw_inf_.sys_inf->os;
957-
if (os == kMacOs && (ne == kOnnxRepo || ne == kTrtLlmRepo)) {
958-
return cpp::fail("Engine " + engine + " is not supported on macOS");
959-
}
960921

961-
if (os == kLinuxOs && ne == kOnnxRepo) {
962-
return cpp::fail("Engine " + engine + " is not supported on Linux");
963-
}
964922
auto installed_variants = GetInstalledEngineVariants(engine);
965923
if (installed_variants.has_error()) {
966924
return cpp::fail(installed_variants.error());

engine/utils/engine_constants.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#pragma once
22

3-
constexpr const auto kOnnxEngine = "onnxruntime";
43
constexpr const auto kLlamaEngine = "llama-cpp";
5-
constexpr const auto kTrtLlmEngine = "tensorrt-llm";
6-
74
constexpr const auto kPythonEngine = "python-engine";
85

96
constexpr const auto kOpenAiEngine = "openai";
@@ -14,15 +11,11 @@ constexpr const auto kRemote = "remote";
1411
constexpr const auto kLocal = "local";
1512

1613

17-
constexpr const auto kOnnxRepo = "cortex.onnx";
1814
constexpr const auto kLlamaRepo = "cortex.llamacpp";
19-
constexpr const auto kTrtLlmRepo = "cortex.tensorrt-llm";
2015
constexpr const auto kPythonRuntimeRepo = "cortex.python";
2116

2217
constexpr const auto kLlamaLibPath = "./engines/cortex.llamacpp";
2318
constexpr const auto kPythonRuntimeLibPath = "/engines/cortex.python";
24-
constexpr const auto kOnnxLibPath = "/engines/cortex.onnx";
25-
constexpr const auto kTensorrtLlmPath = "/engines/cortex.tensorrt-llm";
2619

2720
// other constants
2821
constexpr auto static kHuggingFaceHost = "huggingface.co";

0 commit comments

Comments
 (0)