Skip to content

Conversation

@grahamking
Copy link
Contributor

@grahamking grahamking commented Aug 6, 2025

Summary by CodeRabbit

  • Chores
    • Updated dependencies for improved stability and compatibility, including upgrades to llama-cpp-2, mistralrs, candle-core, cudarc, and tokenizers.
    • Removed an unused feature related to dynamic linking in one of the engine components.
    • Simplified internal configuration by using default settings for a model loader.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Walkthrough

This set of changes updates dependency versions in several Cargo.toml files across different engine libraries, including llama-cpp-2, mistralrs, candle-core, cudarc, and tokenizers. Additionally, it simplifies the construction of a configuration struct in the MistralRs engine code by using its default implementation.

Changes

Cohort / File(s) Change Summary
llama-cpp-2 Dependency Update
lib/engines/llamacpp/Cargo.toml
Removed the "dynamic-link" feature and its comment; updated llama-cpp-2 from 0.1.107 to 0.1.108.
mistralrs Dependency Update
lib/engines/mistralrs/Cargo.toml
Updated mistralrs dependency Git revision from 8a4faf3 to 53ebc74.
MistralRs Config Simplification
lib/engines/mistralrs/src/lib.rs
Replaced manual construction of GGUFSpecificConfig with GGUFSpecificConfig::default() in engine init.
llm Dependency Updates
lib/llm/Cargo.toml
Updated candle-core (0.8.0→0.9.1), cudarc (0.16.2→0.16.6), and tokenizers (0.21.2→0.21.4) dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MistralRsEngine
    participant GGUFSpecificConfig

    User->>MistralRsEngine: new()
    MistralRsEngine->>GGUFSpecificConfig: default()
    GGUFSpecificConfig-->>MistralRsEngine: returns config
    MistralRsEngine-->>User: engine instance
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

A hop, a skip, dependencies rise,
With versions fresh and configs wise.
No more manual fields to set—
Defaults now do all the rest!
The engines hum, the code runs neat,
This bunny’s work is quite complete. 🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2aa504 and e9f7dac.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • lib/bindings/python/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • lib/engines/llamacpp/Cargo.toml (1 hunks)
  • lib/engines/mistralrs/Cargo.toml (1 hunks)
  • lib/engines/mistralrs/src/lib.rs (1 hunks)
  • lib/llm/Cargo.toml (3 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: in docs/support_matrix.md, the nixl version difference between runtime dependencies (0.5.0) and buil...
Learnt from: dmitry-tokarev-nv
PR: ai-dynamo/dynamo#2179
File: docs/support_matrix.md:61-63
Timestamp: 2025-07-30T00:34:35.810Z
Learning: In docs/support_matrix.md, the NIXL version difference between runtime dependencies (0.5.0) and build dependencies (0.4.0) is intentional and expected, not an error that needs to be corrected.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
  • lib/llm/Cargo.toml
📚 Learning: the codebase uses async-nats version 0.40, not the older nats crate. error handling should use async...
Learnt from: kthui
PR: ai-dynamo/dynamo#1424
File: lib/runtime/src/pipeline/network/egress/push_router.rs:204-209
Timestamp: 2025-06-13T22:07:24.843Z
Learning: The codebase uses async-nats version 0.40, not the older nats crate. Error handling should use async_nats::error::Error variants, not nats::Error variants.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
📚 Learning: the asyncenginecontextprovider trait in lib/runtime/src/engine.rs was intentionally changed from `se...
Learnt from: ryanolson
PR: ai-dynamo/dynamo#1919
File: lib/runtime/src/engine.rs:168-168
Timestamp: 2025-07-14T21:25:56.930Z
Learning: The AsyncEngineContextProvider trait in lib/runtime/src/engine.rs was intentionally changed from `Send + Sync + Debug` to `Send + Debug` because the Sync bound was overly constraining. The trait should only require Send + Debug as designed.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
  • lib/engines/mistralrs/src/lib.rs
📚 Learning: in lib/runtime/src/component/client.rs, the current mutex usage in get_or_create_dynamic_instance_so...
Learnt from: grahamking
PR: ai-dynamo/dynamo#1962
File: lib/runtime/src/component/client.rs:270-273
Timestamp: 2025-07-16T12:41:12.543Z
Learning: In lib/runtime/src/component/client.rs, the current mutex usage in get_or_create_dynamic_instance_source is temporary while evaluating whether the mutex can be dropped entirely. The code currently has a race condition between try_lock and lock().await, but this is acknowledged as an interim state during the performance optimization process.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
📚 Learning: the ai-dynamo/dynamo project does not ship arm64 wheels, so platform markers to restrict dependencie...
Learnt from: dmitry-tokarev-nv
PR: ai-dynamo/dynamo#2300
File: pyproject.toml:64-66
Timestamp: 2025-08-05T22:51:59.230Z
Learning: The ai-dynamo/dynamo project does not ship ARM64 wheels, so platform markers to restrict dependencies to x86_64 are not needed in pyproject.toml dependencies.

Applied to files:

  • lib/engines/llamacpp/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: pre-merge-rust (.)
  • GitHub Check: Build and Test - vllm
🔇 Additional comments (6)
lib/engines/mistralrs/Cargo.toml (1)

41-43: Confirm the new mistralrs revision builds across all feature matrices
Moving from 8a4faf3 to 53ebc74 is a non-trivial jump inside an actively developed repo. Down-stream compile failures often appear only for the gated cuda / metal feature combos we enable in CI. Before merging, run the full workspace build (cargo xtask ci) on all targets to ensure the new commit hasn’t introduced breaking API or MSRV changes.

lib/engines/llamacpp/Cargo.toml (1)

30-32: Surface-test the bump to llama-cpp-2 v0.1.108
The crate occasionally ships incompatible FFI changes that only fail at runtime when libllama is pre-loaded. Please run the smoke test suite (dynamo-test llama-cpp) on a machine with the shared library to make sure symbol resolution still succeeds.

lib/llm/Cargo.toml (3)

81-86: candle-core 0.9.x introduced Tensor::view_mut borrowing rules
If we still rely on the pre-0.9 behaviour in our kernels, this bump will cause borrow-checker errors or silent UB behind unsafe. Scan lib/llm/src/** for view_mut( usages and adjust if necessary.


93-97: cudarc patch bump looks safe
0.16.6 only back-ports sm_90 PTX fixes; API is unchanged.


104-109: Tokenizers 0.21.4 ships the new PreTokenizedInput API
No replacement for the soon-to-be-removed encode_batch. Verify we’re not depending on deprecated functions; otherwise the next minor will break us.

lib/engines/mistralrs/src/lib.rs (1)

90-98: Nice—switching to GGUFSpecificConfig::default() is cleaner
Behaviour is unchanged (both fields default to None) and we drop some noise.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Walkthrough

This change updates dependency versions across several Cargo.toml files for the llamacpp, mistralrs, and llm libraries. It removes the "dynamic-link" feature from llamacpp, updates the Git revision for the mistralrs crate, and simplifies the construction of a configuration struct in the mistralrs engine implementation.

Changes

Cohort / File(s) Change Summary
llamacpp dependency and features
lib/engines/llamacpp/Cargo.toml
Removed "dynamic-link" feature, updated llama-cpp-2 dependency from 0.1.107 to 0.1.108.
mistralrs dependency and config
lib/engines/mistralrs/Cargo.toml, lib/engines/mistralrs/src/lib.rs
Updated mistralrs dependency Git revision; replaced explicit GGUFSpecificConfig struct initialization with default().
llm dependencies
lib/llm/Cargo.toml
Updated versions of candle-core (0.8.0 → 0.9.1), cudarc (0.16.2 → 0.16.6), and tokenizers (0.21.2 → 0.21.4).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MistralRsEngine
    participant GGUFSpecificConfig

    User->>MistralRsEngine: new()
    MistralRsEngine->>GGUFSpecificConfig: default()
    GGUFSpecificConfig-->>MistralRsEngine: returns default config
    MistralRsEngine-->>User: Engine initialized
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

A hop and a skip through the Cargo files,
With versions bumped and features trimmed in style.
Mistral and Llama, now fresher than dew,
Default configs make the code easier too.
🐇✨ Dependencies pruned, the garden anew!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
lib/llm/Cargo.toml (1)

83-83: Verify transitive-API compatibility for bumped crates

All three bumps (candle-core 0.9.1, cudarc 0.16.6, tokenizers 0.21.4) look reasonable, but each of these crates introduced minor API tweaks in 0.9/0.16/0.21 lines.
Please run a full workspace cargo check on the PR branch with all feature combinations (testing-full, testing-cuda, etc.) to catch any breakage early.

No code changes needed here—just a heads-up.

Optional: document the minimal crate versions in docs/support_matrix.md to keep them discoverable.

Also applies to: 94-94, 105-109

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2aa504 and dc0b15c.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • lib/bindings/python/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • lib/engines/llamacpp/Cargo.toml (1 hunks)
  • lib/engines/mistralrs/Cargo.toml (1 hunks)
  • lib/engines/mistralrs/src/lib.rs (1 hunks)
  • lib/llm/Cargo.toml (3 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: dmitry-tokarev-nv
PR: ai-dynamo/dynamo#2179
File: docs/support_matrix.md:61-63
Timestamp: 2025-07-30T00:34:35.810Z
Learning: In docs/support_matrix.md, the NIXL version difference between runtime dependencies (0.5.0) and build dependencies (0.4.0) is intentional and expected, not an error that needs to be corrected.
📚 Learning: in docs/support_matrix.md, the nixl version difference between runtime dependencies (0.5.0) and buil...
Learnt from: dmitry-tokarev-nv
PR: ai-dynamo/dynamo#2179
File: docs/support_matrix.md:61-63
Timestamp: 2025-07-30T00:34:35.810Z
Learning: In docs/support_matrix.md, the NIXL version difference between runtime dependencies (0.5.0) and build dependencies (0.4.0) is intentional and expected, not an error that needs to be corrected.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
  • lib/engines/llamacpp/Cargo.toml
  • lib/llm/Cargo.toml
📚 Learning: the codebase uses async-nats version 0.40, not the older nats crate. error handling should use async...
Learnt from: kthui
PR: ai-dynamo/dynamo#1424
File: lib/runtime/src/pipeline/network/egress/push_router.rs:204-209
Timestamp: 2025-06-13T22:07:24.843Z
Learning: The codebase uses async-nats version 0.40, not the older nats crate. Error handling should use async_nats::error::Error variants, not nats::Error variants.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
📚 Learning: the asyncenginecontextprovider trait in lib/runtime/src/engine.rs was intentionally changed from `se...
Learnt from: ryanolson
PR: ai-dynamo/dynamo#1919
File: lib/runtime/src/engine.rs:168-168
Timestamp: 2025-07-14T21:25:56.930Z
Learning: The AsyncEngineContextProvider trait in lib/runtime/src/engine.rs was intentionally changed from `Send + Sync + Debug` to `Send + Debug` because the Sync bound was overly constraining. The trait should only require Send + Debug as designed.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
  • lib/engines/mistralrs/src/lib.rs
📚 Learning: in lib/runtime/src/component/client.rs, the current mutex usage in get_or_create_dynamic_instance_so...
Learnt from: grahamking
PR: ai-dynamo/dynamo#1962
File: lib/runtime/src/component/client.rs:270-273
Timestamp: 2025-07-16T12:41:12.543Z
Learning: In lib/runtime/src/component/client.rs, the current mutex usage in get_or_create_dynamic_instance_source is temporary while evaluating whether the mutex can be dropped entirely. The code currently has a race condition between try_lock and lock().await, but this is acknowledged as an interim state during the performance optimization process.

Applied to files:

  • lib/engines/mistralrs/Cargo.toml
📚 Learning: the ai-dynamo/dynamo project does not ship arm64 wheels, so platform markers to restrict dependencie...
Learnt from: dmitry-tokarev-nv
PR: ai-dynamo/dynamo#2300
File: pyproject.toml:64-66
Timestamp: 2025-08-05T22:51:59.230Z
Learning: The ai-dynamo/dynamo project does not ship ARM64 wheels, so platform markers to restrict dependencies to x86_64 are not needed in pyproject.toml dependencies.

Applied to files:

  • lib/engines/llamacpp/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: pre-merge-rust (.)
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: Mirror Repository to GitLab
  • GitHub Check: Build and Test - vllm
🔇 Additional comments (3)
lib/engines/llamacpp/Cargo.toml (1)

31-31: Confirm no lingering dynamic-link references

I ran a repository-wide search for “dynamic-link” and found no matches. However, absence of results isn’t definitive—please manually verify that:

  • No downstream Cargo.toml still lists dynamic-link in a features section
  • There are no #[cfg(feature = "dynamic-link")] gates in the codebase

This will ensure the workspace compiles cleanly after the llama-cpp-2 = { version = "0.1.108", default-features = false } update.

lib/engines/mistralrs/Cargo.toml (1)

42-42: Pinned commit updated – keep an eye on upstream API drift

The mistralrs rev moves from 8a4faf353ebc74. Good to stay current, but because we vendor by commit hash, any force-push upstream will silently break reproducible builds. Consider switching to a version tag once 0.6.x stabilises.

lib/engines/mistralrs/src/lib.rs (1)

95-96: Simplification OK – semantics unchanged

Replacing the manual GGUFSpecificConfig { .. } construction with GGUFSpecificConfig::default() is equivalent (all fields were None). No functional impact observed.

@grahamking grahamking enabled auto-merge (squash) August 6, 2025 19:20
Copy link
Contributor

@rmccorm4 rmccorm4 left a comment

Choose a reason for hiding this comment

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

LGTM - left a question on candle-core condensing

FYI - rust check failing for unrelated reason to this PR - from disk space issue due to caching - looking into it

@grahamking grahamking merged commit dbe48a1 into main Aug 6, 2025
12 of 14 checks passed
@grahamking grahamking deleted the gk-mistralrs-bump branch August 6, 2025 20:23
@da-x
Copy link
Contributor

da-x commented Aug 6, 2025

FYI: looks like this change causes a build regression:

Works:
✅ no features
--features cuda
--features dynamo-llm/block-manage

Doesn't work:
--features cuda,dynamo-llm/block-manage
The cudarc crate build breaks: "Both dynamic-loading and dynamic-linking features are active, this is a bug"

@grahamking
Copy link
Contributor Author

This PR also adds support for CUDA 12.9.

@grahamking
Copy link
Contributor Author

@da-x Did that double-feature work with cudarc 0.16.2?

@da-x
Copy link
Contributor

da-x commented Aug 6, 2025

@grahamking

  • Before that change, mistral linked to cudarc 0.13.9 with dynamic linking, while Dynamo linked to 0.16.2 with dynamic loading. So they didn't see each other in the build process and it somehow worked.
  • With the consolidation to 0.16.6 a single cudarc is used, and therefore feature selection intersects with this conflict.
  • My fix resolves the issue: 3e3133e

@grahamking
Copy link
Contributor Author

Nice. Would you mind send a PR and tagging @ryanolson ? He added cudarc for block manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants