Skip to content

Session refactor and execution provider management#390

Merged
javiermtorres merged 15 commits intomainfrom
feat/execution-providers
Apr 18, 2026
Merged

Session refactor and execution provider management#390
javiermtorres merged 15 commits intomainfrom
feat/execution-providers

Conversation

@javiermtorres
Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.00897% with 165 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
encoderfile/src/transport/cli.rs 0.00% 111 Missing ⚠️
encoderfile/src/runtime/session.rs 56.98% 40 Missing ⚠️
encoderfile/src/runtime/loader.rs 0.00% 12 Missing ⚠️
encoderfile-runtime/src/main.rs 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
encoderfile/src/builder/builder.rs 89.04% <ø> (-0.15%) ⬇️
encoderfile/src/builder/model.rs 91.30% <100.00%> (-0.54%) ⬇️
encoderfile/src/dev_utils/mod.rs 97.91% <100.00%> (-0.05%) ⬇️
encoderfile/src/format/codec/decoder.rs 98.73% <ø> (-0.04%) ⬇️
encoderfile/src/format/codec/encoder.rs 96.21% <ø> (-0.09%) ⬇️
encoderfile/src/format/codec/mod.rs 100.00% <ø> (ø)
encoderfile/src/format/container.rs 97.85% <ø> (-0.02%) ⬇️
encoderfile-runtime/src/main.rs 0.00% <0.00%> (ø)
encoderfile/src/runtime/loader.rs 56.47% <0.00%> (-7.53%) ⬇️
encoderfile/src/runtime/session.rs 56.98% <56.98%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor Author

@javiermtorres javiermtorres left a comment

Choose a reason for hiding this comment

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

LGTM

impl ModelTypeExt for crate::common::ModelType {
fn validate_model<'a>(&self, path: &'a Path) -> Result<PlannedAsset<'a>> {
let model = load_model(path)?;
let model = ORTSessionBuilder::default().from_file(path)?;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since this is done just once, we can do away with early building a session, right?

}

fn get_tensorrt_provider(device_id: i32) -> Result<ExecutionProviderDispatch> {
if !CUDA_ENABLED {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is CUDA available whenever TensorRT is? Otherwise we might need specific flags.

#[arg(long, default_value_t = false)]
disable_cpu_fallback: bool,
#[arg(long)]
graph_optimization_level: Option<GraphOptimizationLevel>,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I suppose clap gives an appropriate error if we step out of the possible values, right?

@javiermtorres javiermtorres merged commit 5b7c04e into main Apr 18, 2026
4 checks passed
@javiermtorres javiermtorres deleted the feat/execution-providers branch April 18, 2026 14:48
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