Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 37 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ add_library(trtmc_core SHARED
src/tokenizer/wordpiece_tokenizer.cpp
src/tokenizer/unigram_tokenizer.cpp
# Utilities
src/utils/data_dir.cpp
src/utils/text_parsers.cpp
src/utils/json_helpers.cpp
src/cli/jsonl_io.cpp
Expand Down Expand Up @@ -780,6 +779,34 @@ set_target_properties(trtmc_test_optimized_embedding PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests/optimized-runtimes/embedding"
)

add_library(trtmc_test_model_plugin_missing_abi SHARED EXCLUDE_FROM_ALL
tests/cpp/fakes/fake_model_plugin_abi.cpp
)
target_include_directories(trtmc_test_model_plugin_missing_abi PRIVATE
${PROJECT_SOURCE_DIR}/include
)
target_compile_definitions(trtmc_test_model_plugin_missing_abi PRIVATE
TRTMC_FAKE_MODEL_PLUGIN_OMIT_ABI=1
)
set_target_properties(trtmc_test_model_plugin_missing_abi PROPERTIES
OUTPUT_NAME trtmc_test_model_plugin_abi
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests/model-plugin-abi/missing"
)

add_library(trtmc_test_model_plugin_wrong_abi SHARED EXCLUDE_FROM_ALL
tests/cpp/fakes/fake_model_plugin_abi.cpp
)
target_include_directories(trtmc_test_model_plugin_wrong_abi PRIVATE
${PROJECT_SOURCE_DIR}/include
)
target_compile_definitions(trtmc_test_model_plugin_wrong_abi PRIVATE
TRTMC_FAKE_MODEL_PLUGIN_ABI_VERSION=1
)
set_target_properties(trtmc_test_model_plugin_wrong_abi PROPERTIES
OUTPUT_NAME trtmc_test_model_plugin_abi
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests/model-plugin-abi/wrong"
)

# --- Test helper function ---
# Usage:
# trtmc_add_test(test_name) -- links trtmc_core, adds src/ include
Expand Down Expand Up @@ -902,6 +929,15 @@ trtmc_add_test(test_bundle_view)
trtmc_add_test(test_pipeline_registry)
trtmc_add_test(test_model_plugin_loader MODEL_OWNED)
add_dependencies(test_model_plugin_loader trtmc_model_plugins)
trtmc_add_test(test_model_plugin_abi)
add_dependencies(test_model_plugin_abi
trtmc_test_model_plugin_missing_abi
trtmc_test_model_plugin_wrong_abi
)
target_compile_definitions(test_model_plugin_abi PRIVATE
TRTMC_TEST_MODEL_PLUGIN_MISSING_ABI_DSO="$<TARGET_FILE:trtmc_test_model_plugin_missing_abi>"
TRTMC_TEST_MODEL_PLUGIN_WRONG_ABI_DSO="$<TARGET_FILE:trtmc_test_model_plugin_wrong_abi>"
)
trtmc_add_test(test_backend_loader)
trtmc_add_test(test_trt_version)
trtmc_add_test(test_runtime_measurement)
Expand Down Expand Up @@ -940,7 +976,6 @@ trtmc_add_test(test_cabi_batch NO_SRC_INCLUDE)
# Config / parsing
trtmc_add_test(test_text_parsers)
trtmc_add_test(test_json_helpers)
trtmc_add_test(test_data_dir)
trtmc_add_test(test_cli_args)
target_sources(test_cli_args PRIVATE src/cli/args.cpp)
trtmc_add_test(test_jsonl_dataset_and_output
Expand Down
18 changes: 0 additions & 18 deletions benchmarks/performance/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -724,24 +724,6 @@ entries:
runner: hf-transformers
mode: torch-compile
compile_scope: model.forward
- id: qwen3_omni.generate_audio
family: qwen3_omni
operation: generate_audio
model: qwen3-omni-30b-a3b-instruct
workload:
testcase: qwen3-omni-30b-a3b-instruct
baseline:
runner: task-reference
adapter: hf-qwen3-omni
mode: hf-eager
reference_backend: hf_transformers
timing_scope: task-model-call-wall
input_preparation_included: false
output_contract: audio-shape
adapter_options:
device_map: cuda:0
speaker: Ethan
talker_max_new_tokens: 32
- id: qwen_image.generate_image
family: qwen_image
operation: generate_image
Expand Down
5 changes: 5 additions & 0 deletions cmake/register_model_plugin.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Generated by cmake/trtmc_pipeline_plugins.cmake. Do not edit.

#include "trtmc/config/schema_registry.h"
#include "trtmc/runtime/pipeline_plugin_loader.h"
#include "trtmc/runtime/pipeline_registry.h"

namespace trtmc {
Expand All @@ -18,6 +19,10 @@ namespace config::schemas {

} // namespace trtmc

extern "C" std::uint32_t trtmc_model_plugin_abi_version() {
return ::trtmc::kModelPluginAbiVersion;
}

extern "C" const char* trtmc_model_plugin_id() {
return "@TRTMC_MODEL_PLUGIN_ID@";
}
Expand Down
1 change: 0 additions & 1 deletion examples/trtmc_benchmark_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ std::vector<float> optional_float32_values(const Json& request, const std::strin

trtmc::LoadOptions load_options(const Json& runtime) {
trtmc::LoadOptions options;
options.hf_python = optional_value<std::string>(runtime, "hf_python", "");
options.runtime_cache_path = optional_value<std::string>(runtime, "runtime_cache_path", "");
options.cuda_graphs = optional_value<bool>(runtime, "cuda_graphs", false);
options.kv_cache_size_bytes = optional_value<std::uint64_t>(runtime, "kv_cache_size_bytes", 0);
Expand Down
4 changes: 1 addition & 3 deletions examples/trtmc_dataset_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ std::optional<std::string> extract_answer_from_text(const std::string& text) {

void usage() {
std::cerr << "Usage: trtmc_dataset_benchmark <bundle.bundle> <dataset.jsonl> <output.jsonl> "
"[--max-new-tokens N] [--hf-python PATH] [--kv-cache-size SIZE] "
"[--max-new-tokens N] [--kv-cache-size SIZE] "
"[--backend-dir PATH] [--model-plugin-dir PATH] "
"[--temperature F] [--top-k N] [--top-p F] [--min-p F] [--seed N] "
"[--chat-template] [--no-thinking] [--stop-on-answer] "
Expand Down Expand Up @@ -153,8 +153,6 @@ int main(int argc, char** argv) {
set_tokens.emplace_back(need_value(arg));
} else if (arg == "--max-new-tokens") {
max_new_tokens = std::stoi(need_value(arg));
} else if (arg == "--hf-python") {
load_options.hf_python = need_value(arg);
} else if (arg == "--kv-cache-size") {
load_options.kv_cache_size_bytes = parse_size_bytes(need_value(arg));
} else if (arg == "--backend-dir") {
Expand Down
8 changes: 2 additions & 6 deletions include/trtmc/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,8 @@ class IPipeline {

// --- Factory ---
// LoadOptions bundles every knob the factory understands. Users who only want
// the defaults can still call the positional overload below.
// the defaults can call the single-argument overload below.
struct LoadOptions {
std::string hf_python;
std::string runtime_cache_path;
bool cuda_graphs{false};
std::uint64_t kv_cache_size_bytes{0}; // 0 = use bundle's max_cache_length
Expand All @@ -703,9 +702,7 @@ struct LoadOptions {
std::vector<std::string> model_plugin_search_paths; // Extra dirs for libtrtmc_model_*.so
};

std::unique_ptr<IPipeline> load(const std::string& bundle_path, const std::string& hf_python = "",
const std::string& runtime_cache_path = "",
bool cuda_graphs = false);
std::unique_ptr<IPipeline> load(const std::string& bundle_path);
std::unique_ptr<IPipeline> load(const std::string& bundle_path, const LoadOptions& options);
std::unique_ptr<IPipeline> load(const std::string& bundle_path, const LoadOptions& options,
const std::string& kernel_bindings_path);
Expand All @@ -718,7 +715,6 @@ extern "C" {

struct TrtmcPipelineOptions {
int max_new_tokens; // 0 = use model default
const char* hf_python; // nullptr = auto-detect
const char* image_path; // nullptr = text-only
const char* runtime_cache; // nullptr = no RTX cache
int cuda_graphs; // 0 = disabled
Expand Down
5 changes: 1 addition & 4 deletions include/trtmc/runtime/pipeline_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ class PipelinePool;

class PipelineFactory {
public:
static std::unique_ptr<IPipeline> from_bundle(const std::string& bundle_path,
const std::string& hf_python = "",
const std::string& runtime_cache_path = "",
bool cuda_graphs = false);
static std::unique_ptr<IPipeline> from_bundle(const std::string& bundle_path);
static std::unique_ptr<IPipeline> from_bundle(const std::string& bundle_path,
const LoadOptions& options);
static std::unique_ptr<IPipeline> from_bundle(const std::string& bundle_path,
Expand Down
1 change: 0 additions & 1 deletion include/trtmc/runtime/pipeline_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ struct PipelineContext {
const BundleFile& bundle;
const BaseConfig& config;
const std::string& config_json; // raw JSON text from bundle
const std::string& hf_python; // path to HF Python interpreter
const std::string& bundle_path; // filesystem path to .bundle file
IBackend* backend; // Backend for creating ITrtModule instances
const std::string& runtime_cache_path; // RTX: JIT kernel cache file path
Expand Down
5 changes: 5 additions & 0 deletions include/trtmc/runtime/pipeline_plugin_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@

#pragma once

#include <cstdint>
#include <optional>
#include <string>
#include <vector>

namespace trtmc {

// Exact-match epoch: pre-1.0 runtimes accept only model DSOs built for this version.
inline constexpr std::uint32_t kModelPluginAbiVersion = 2;
inline constexpr const char* kModelPluginAbiEntrypoint = "trtmc_model_plugin_abi_version";

struct ModelPluginInfo {
const char* model_id;
const char* runtime_strategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ PYTHONPATH=python:. python3 tools/diff_vl.py \
--image /path/to/test.jpg \
--model <model> \
--binary ./build/trtmc \
--hf-python <python> \
--debug-layers
```

Expand All @@ -135,7 +134,6 @@ PYTHONPATH=python:. python3 tools/diff_audio.py \
--bundle /tmp/model.bundle \
--binary ./build/trtmc \
--model <model> \
--hf-python <python> \
--stage 1
```

Expand All @@ -162,7 +160,6 @@ When Python/reference parity passes but the C++ result differs:
PYTHONPATH=python:. python3 tools/test_runner_parity.py \
--bundle /tmp/model.bundle \
--binary ./build/trtmc \
--hf-python <python> \
--prompt "The capital of France is" \
--max-new-tokens 20
```
Expand Down
1 change: 0 additions & 1 deletion plugins/trtmc-agent-skills/skills/profile-model/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ PYTHONPATH=python:. python3 tools/trtmc_profile.py \
--iterations 10 \
--dtype float16 \
--trtmc-binary ./build/trtmc \
--hf-python <python> \
--json \
--output-dir <profile-dir>
```
Expand Down
Loading
Loading