Skip to content

feat: harden aic-core wheel and crate API contracts#1375

Open
jasonqinzhou wants to merge 2 commits into
mainfrom
agent/harden-aic-core-public-api
Open

feat: harden aic-core wheel and crate API contracts#1375
jasonqinzhou wants to merge 2 commits into
mainfrom
agent/harden-aic-core-public-api

Conversation

@jasonqinzhou

@jasonqinzhou jasonqinzhou commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • define a small lazy aiconfigurator_core.sdk facade for the supported Python API
  • ship py.typed plus a native-extension stub and verify both in built/installed wheels
  • add a typed Rust AicEngineBuilder while preserving build_aic_engine compatibility
  • compile a separate workspace crate against the public Rust exports
  • enforce wheel/crate version and wire-schema contracts
  • add a dedicated CI job for Python contracts and Rust tests with embedding off and fully enforced
  • document the wheel/crate API and compatibility policy

Validation

  • 84 passed: Python facade, import identity, version/schema, and package-layer tests
  • cargo test --workspace --no-default-features: 192 core + 3 external-consumer tests
  • cargo test --workspace --all-features: 197 core + 3 embedding integration + 3 external-consumer tests
  • embedding tests rerun with AIC_REQUIRE_EMBEDDED_ROUND_TRIP=1 so skips are impossible
  • real release wheels verified: 715 upper + 1,159 core payload files with no overlap
  • fresh core-only wheel install verified, including a real MiniMax engine compile and positive prefill/decode latencies
  • cargo package -p aiconfigurator-core --allow-dirty packaged and verified the publishable crate
  • Ruff, Rustfmt on changed Rust sources, workflow YAML parse, and diff whitespace checks pass

Summary by CodeRabbit

  • New Features
    • Added an ergonomic Rust AicEngineBuilder with fluent configuration for model/backend, parallelism, quantization, speculative decoding, and cache sizing.
    • Added a stable aiconfigurator_core.sdk Python facade with lazy-loaded exports.
    • Added Python typing support via *.pyi stubs and py.typed.
  • Documentation
    • Expanded core API/compatibility and Rust usage guidance.
  • Bug Fixes
    • Tightened release wheel validation to require typing artifacts and the expected SDK surface.
  • Tests
    • Added/strengthened cross-language public API, version/schema, and embedded-runtime contract coverage.

@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@jasonqinzhou
jasonqinzhou force-pushed the agent/harden-aic-core-public-api branch from 6564991 to 3fd72d2 Compare July 16, 2026 17:34
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5e155cd3-0be1-4b78-9cf5-85f6005d9c8f

📥 Commits

Reviewing files that changed from the base of the PR and between fdae85f and f85a9d0.

📒 Files selected for processing (6)
  • .github/workflows/build-test.yml
  • aic-core/API.md
  • aic-core/rust/aiconfigurator-core/README.md
  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
  • tools/verify_installed_package_layers.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/cross_package/test_core_version_contract.py
  • aic-core/API.md
  • aic-core/rust/aiconfigurator-core/README.md
  • tools/verify_installed_package_layers.py
📜 Recent review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: Collect snapshot (new)
  • GitHub Check: Collect snapshot (old)
  • GitHub Check: Build and Test (unit)
  • GitHub Check: Cargo Deny
  • GitHub Check: Rust/Python engine-step parity
  • GitHub Check: aic-core public API contract
  • GitHub Check: Build and Test (e2e)
🧰 Additional context used
📓 Path-based instructions (6)
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: - Review workflow edits for least-privilege permissions, safe trigger scopes, secret exposure, fork behavior, and release/cherry-pick side effects.

  • Verify matrix jobs, artifact uploads, and scheduled support-matrix workflows still produce debuggable evidence.

Files:

  • .github/workflows/build-test.yml
tests/**/*.{py,yaml,txt,sh}

📄 CodeRabbit inference engine (.claude/rules/generator/testing.md)

Use integration tests for the full input-to-artifacts pipeline, comparing output against golden snapshots without external dependencies.

Files:

  • tests/cross_package/test_core_public_api.py
**/*

📄 CodeRabbit inference engine (.claude/rules/repo-guide.md)

**/*: Treat this file as the only always-injected rule file; do not add new always-on rules here without human approval. New rule files must include paths: frontmatter.
When reviewing changes in a governed area, read that area's rule files first, even if path-based auto-loading does not occur during a read-only review. Rule violations are review findings even when the code works.
A task must remain within its module: collector tasks may change only collector/ and its tests, generator tasks only src/aiconfigurator/generator/ and its tests, and SDK tasks must not modify either. Cross-module contract changes require explicit human approval.

Files:

  • tests/cross_package/test_core_public_api.py

⚙️ CodeRabbit configuration file

**/*: - Prefer applicable inline comments. When the correct fix is clear, small, and limited to the commented diff hunk, include it as a GitHub Suggested Change so the author can apply it with one click.

  • Do not use a suggested change when the fix requires broader design choices, multiple files, generated artifacts, unavailable context, or validation that cannot be inferred from the diff.
  • If a comment is not directly applicable, state the smallest concrete next step and why a one-click suggestion is not safe.

Files:

  • tests/cross_package/test_core_public_api.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (AGENTS.md)

Run ruff check . and ruff format --check . to validate Python linting and formatting.

Files:

  • tests/cross_package/test_core_public_api.py
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Run unit tests with pytest -m unit; use pytest -m "unit or build" for the build-test subset when required data is available.

Files:

  • tests/cross_package/test_core_public_api.py
tests/**

⚙️ CodeRabbit configuration file

tests/**: - Check that tests cover the changed behavior rather than only the happy path.

  • Watch for fixtures or golden outputs that mask backend drift, support-matrix ordering changes, or CLI output regressions.

Files:

  • tests/cross_package/test_core_public_api.py
🪛 ast-grep (0.44.1)
tests/cross_package/test_core_public_api.py

[error] 44-44: Command coming from incoming request
Context: subprocess.run([sys.executable, "-c", script], check=True)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(subprocess-from-request)

🔇 Additional comments (3)
.github/workflows/build-test.yml (1)

37-38: LGTM!

tests/cross_package/test_core_public_api.py (2)

10-11: LGTM!


31-45: LGTM!


Walkthrough

Changes

Core Public API Contract

Layer / File(s) Summary
Python facade and typing contract
aiconfigurator_core/..., tests/cross_package/test_core_public_api.py
Adds lazy SDK exports, PyO3 stubs, py.typed, and tests for facade names, signatures, identity, and typing artifacts.
Rust builder and external crate contract
aic-core/rust/aiconfigurator-core/..., aic-core/rust/public-api-tests/..., aic-core/API.md
Adds and re-exports AicEngineBuilder, documents Rust API surfaces, and validates external-crate construction and public types.
Feature-gated Rust validation
aic-core/rust/aiconfigurator-core/src/..., aic-core/rust/aiconfigurator-core/tests/...
Restricts embedding tests to embed-python, updates embedded import guidance, and derives latency expectations from system specifications.
Package, version, and CI enforcement
.github/workflows/build-test.yml, Cargo.toml, tests/cross_package/test_core_version_contract.py, tools/...
Adds workspace and CI contract coverage, checks Python/Rust versions and schemas, and requires facade and typing files in installed wheels.

Estimated code review effort: 4 (Complex) | ~45 minutes

Poem

Builders click, facades unfold,
Typed little contracts guard the gold.
Rust and Python share their tune,
CI checks each API moon.
Wheels carry stubs beneath the moon.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and validation, but it misses the required Overview, Details, reviewer-start, and related-issue sections. Rewrite the PR body to match the template with Overview, Details, Where should reviewer start?, and a Related Issues line.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: hardening the aic-core wheel and crate API contracts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Jason Zhou (Engrg-Hardware 1) <jasonzho@nvidia.com>
@jasonqinzhou
jasonqinzhou force-pushed the agent/harden-aic-core-public-api branch from 3fd72d2 to fdae85f Compare July 16, 2026 17:36
@jasonqinzhou jasonqinzhou changed the title Harden aic-core wheel and crate public API contracts feat: harden aic-core wheel and crate API contracts Jul 16, 2026
@github-actions github-actions Bot added the feat label Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-test.yml:
- Around line 33-36: Add an explicit read-only permissions block to the
core-public-api-contract job, scoped to the job definition alongside runs-on and
timeout-minutes. Grant only the contents access needed for checkout and test
reads, with no write permissions.

In `@aic-core/rust/aiconfigurator-core/src/py.rs`:
- Around line 429-449: Document in
aic-core/rust/aiconfigurator-core/README.md:25-49 that standalone Rust callers
using AicEngineBuilder::build must enable the embed-python/pyo3::auto-initialize
prerequisite or initialize a host Python interpreter before calling it. The
AicEngineBuilder::build implementation at
aic-core/rust/aiconfigurator-core/src/py.rs:429-449 requires no direct code
change; update the README example and setup guidance to make this runtime
requirement explicit.

In `@tests/cross_package/test_core_public_api.py`:
- Around line 11-16: Add an isolated lazy-import assertion in the test module,
using a fresh interpreter or subprocess before importing the facade target
modules. Verify that importing the SDK facade alone does not preload its target
modules, then retain the existing API behavior checks; avoid top-level imports
of those targets that would mask eager initialization.

In `@tools/verify_installed_package_layers.py`:
- Around line 72-86: The verification flow must import aiconfigurator_core.sdk
in a fresh interpreter before preloading or importing any implementation
modules. Update the logic around the sdk facade check to assert the protected
implementation modules are absent from sys.modules immediately after that
import, then perform the existing direct submodule-import validation. Preserve
the expected_facade and public-name checks after confirming the lazy-import
boundary.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 15e84acb-fce6-44c7-b195-14209564de0e

📥 Commits

Reviewing files that changed from the base of the PR and between f4c5845 and fdae85f.

📒 Files selected for processing (21)
  • .github/workflows/build-test.yml
  • Cargo.toml
  • aic-core/API.md
  • aic-core/rust/aiconfigurator-core/Cargo.toml
  • aic-core/rust/aiconfigurator-core/README.md
  • aic-core/rust/aiconfigurator-core/src/common/system_spec.rs
  • aic-core/rust/aiconfigurator-core/src/lib.rs
  • aic-core/rust/aiconfigurator-core/src/operators/attention.rs
  • aic-core/rust/aiconfigurator-core/src/py.rs
  • aic-core/rust/aiconfigurator-core/tests/embedded_round_trip.rs
  • aic-core/rust/aiconfigurator-core/tests/memory_round_trip.rs
  • aic-core/rust/aiconfigurator-core/tests/pyo3_smoke.rs
  • aic-core/rust/public-api-tests/Cargo.toml
  • aic-core/rust/public-api-tests/src/lib.rs
  • aic-core/src/aiconfigurator_core/_aiconfigurator_core.pyi
  • aic-core/src/aiconfigurator_core/py.typed
  • aic-core/src/aiconfigurator_core/sdk/__init__.py
  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
  • tools/verify_installed_package_layers.py
  • tools/verify_release_wheels.py
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: Collect snapshot (old)
  • GitHub Check: Collect snapshot (new)
  • GitHub Check: Rust/Python engine-step parity
  • GitHub Check: Build and Test (unit)
  • GitHub Check: Build and Test (e2e)
  • GitHub Check: Cargo Deny
🧰 Additional context used
📓 Path-based instructions (7)
**/*

📄 CodeRabbit inference engine (.claude/rules/repo-guide.md)

**/*: Treat this file as the only always-injected rule file; do not add new always-on rules here without human approval. New rule files must include paths: frontmatter.
When reviewing changes in a governed area, read that area's rule files first, even if path-based auto-loading does not occur during a read-only review. Rule violations are review findings even when the code works.
A task must remain within its module: collector tasks may change only collector/ and its tests, generator tasks only src/aiconfigurator/generator/ and its tests, and SDK tasks must not modify either. Cross-module contract changes require explicit human approval.

Files:

  • Cargo.toml
  • aic-core/rust/aiconfigurator-core/Cargo.toml
  • aic-core/rust/aiconfigurator-core/tests/pyo3_smoke.rs
  • aic-core/rust/aiconfigurator-core/src/common/system_spec.rs
  • aic-core/rust/aiconfigurator-core/src/operators/attention.rs
  • aic-core/src/aiconfigurator_core/py.typed
  • aic-core/rust/public-api-tests/Cargo.toml
  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
  • aic-core/rust/aiconfigurator-core/src/lib.rs
  • aic-core/rust/public-api-tests/src/lib.rs
  • aic-core/rust/aiconfigurator-core/tests/memory_round_trip.rs
  • aic-core/API.md
  • tools/verify_installed_package_layers.py
  • aic-core/rust/aiconfigurator-core/README.md
  • aic-core/src/aiconfigurator_core/_aiconfigurator_core.pyi
  • aic-core/src/aiconfigurator_core/sdk/__init__.py
  • tools/verify_release_wheels.py
  • aic-core/rust/aiconfigurator-core/tests/embedded_round_trip.rs
  • aic-core/rust/aiconfigurator-core/src/py.rs

⚙️ CodeRabbit configuration file

**/*: - Prefer applicable inline comments. When the correct fix is clear, small, and limited to the commented diff hunk, include it as a GitHub Suggested Change so the author can apply it with one click.

  • Do not use a suggested change when the fix requires broader design choices, multiple files, generated artifacts, unavailable context, or validation that cannot be inferred from the diff.
  • If a comment is not directly applicable, state the smallest concrete next step and why a one-click suggestion is not safe.

Files:

  • Cargo.toml
  • aic-core/rust/aiconfigurator-core/Cargo.toml
  • aic-core/rust/aiconfigurator-core/tests/pyo3_smoke.rs
  • aic-core/rust/aiconfigurator-core/src/common/system_spec.rs
  • aic-core/rust/aiconfigurator-core/src/operators/attention.rs
  • aic-core/src/aiconfigurator_core/py.typed
  • aic-core/rust/public-api-tests/Cargo.toml
  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
  • aic-core/rust/aiconfigurator-core/src/lib.rs
  • aic-core/rust/public-api-tests/src/lib.rs
  • aic-core/rust/aiconfigurator-core/tests/memory_round_trip.rs
  • aic-core/API.md
  • tools/verify_installed_package_layers.py
  • aic-core/rust/aiconfigurator-core/README.md
  • aic-core/src/aiconfigurator_core/_aiconfigurator_core.pyi
  • aic-core/src/aiconfigurator_core/sdk/__init__.py
  • tools/verify_release_wheels.py
  • aic-core/rust/aiconfigurator-core/tests/embedded_round_trip.rs
  • aic-core/rust/aiconfigurator-core/src/py.rs
tests/**/*.{py,yaml,txt,sh}

📄 CodeRabbit inference engine (.claude/rules/generator/testing.md)

Use integration tests for the full input-to-artifacts pipeline, comparing output against golden snapshots without external dependencies.

Files:

  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (AGENTS.md)

Run ruff check . and ruff format --check . to validate Python linting and formatting.

Files:

  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
  • tools/verify_installed_package_layers.py
  • aic-core/src/aiconfigurator_core/_aiconfigurator_core.pyi
  • aic-core/src/aiconfigurator_core/sdk/__init__.py
  • tools/verify_release_wheels.py
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Run unit tests with pytest -m unit; use pytest -m "unit or build" for the build-test subset when required data is available.

Files:

  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
tests/**

⚙️ CodeRabbit configuration file

tests/**: - Check that tests cover the changed behavior rather than only the happy path.

  • Watch for fixtures or golden outputs that mask backend drift, support-matrix ordering changes, or CLI output regressions.

Files:

  • tests/cross_package/test_core_public_api.py
  • tests/cross_package/test_core_version_contract.py
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: - Review workflow edits for least-privilege permissions, safe trigger scopes, secret exposure, fork behavior, and release/cherry-pick side effects.

  • Verify matrix jobs, artifact uploads, and scheduled support-matrix workflows still produce debuggable evidence.

Files:

  • .github/workflows/build-test.yml
aic-core/src/aiconfigurator_core/sdk/**

⚙️ CodeRabbit configuration file

aic-core/src/aiconfigurator_core/sdk/**: - Verify core SDK API changes remain compatible with legacy aiconfigurator.sdk imports, generator inputs, profiler data flow, and documented examples.

  • Flag upper-layer dependencies or silent schema drift introduced into the minimal core distribution.

Files:

  • aic-core/src/aiconfigurator_core/sdk/__init__.py
🪛 ast-grep (0.44.1)
tests/cross_package/test_core_version_contract.py

[warning] 30-30: Regex pattern passed to re is built from a non-literal (variable, call, concatenation, or f-string) value. If that value is attacker-controlled it can introduce a malicious pattern with catastrophic backtracking (ReDoS). Use a hardcoded literal pattern, or validate/escape untrusted input with re.escape() and bound the regex complexity before compiling.
Context: re.search(rf"^pub const {name}: u32 = (\d+);$", source, re.MULTILINE)
Note: [CWE-1333] Inefficient Regular Expression Complexity.

(redos-non-literal-regex-python)

🪛 zizmor (1.26.1)
.github/workflows/build-test.yml

[warning] 33-67: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

🔇 Additional comments (21)
aic-core/API.md (1)

1-120: LGTM!

aic-core/src/aiconfigurator_core/_aiconfigurator_core.pyi (1)

1-41: LGTM!

aic-core/src/aiconfigurator_core/py.typed (1)

1-1: LGTM!

aic-core/src/aiconfigurator_core/sdk/__init__.py (1)

4-67: LGTM!

tests/cross_package/test_core_public_api.py (1)

18-64: LGTM!

aic-core/rust/public-api-tests/src/lib.rs (1)

1-71: LGTM!

Cargo.toml (1)

5-8: LGTM!

tests/cross_package/test_core_version_contract.py (1)

1-46: LGTM!

tools/verify_release_wheels.py (1)

15-29: LGTM!

Also applies to: 115-162

aic-core/rust/aiconfigurator-core/src/py.rs (1)

38-38: LGTM!

Also applies to: 291-428, 453-493, 879-879

aic-core/rust/aiconfigurator-core/src/lib.rs (1)

59-59: LGTM!

aic-core/rust/public-api-tests/Cargo.toml (1)

1-12: LGTM!

aic-core/rust/aiconfigurator-core/Cargo.toml (1)

10-12: LGTM!

aic-core/rust/aiconfigurator-core/README.md (1)

131-138: LGTM!

aic-core/rust/aiconfigurator-core/src/common/system_spec.rs (1)

164-164: LGTM!

aic-core/rust/aiconfigurator-core/src/operators/attention.rs (1)

346-352: LGTM!

aic-core/rust/aiconfigurator-core/tests/embedded_round_trip.rs (1)

39-39: LGTM!

Also applies to: 54-55, 88-89

aic-core/rust/aiconfigurator-core/tests/memory_round_trip.rs (1)

32-32: LGTM!

Also applies to: 45-46, 128-129

aic-core/rust/aiconfigurator-core/tests/pyo3_smoke.rs (1)

12-13: LGTM!

tools/verify_installed_package_layers.py (2)

51-53: LGTM!


43-86: 📐 Maintainability & Code Quality

No action needed.

Comment thread .github/workflows/build-test.yml
Comment thread aic-core/rust/aiconfigurator-core/src/py.rs
Comment thread tests/cross_package/test_core_public_api.py
Comment thread tools/verify_installed_package_layers.py Outdated
@jasonqinzhou
jasonqinzhou marked this pull request as ready for review July 16, 2026 18:13
@jasonqinzhou
jasonqinzhou requested review from a team as code owners July 16, 2026 18:13
Signed-off-by: Jason Zhou (Engrg-Hardware 1) <jasonzho@nvidia.com>
.expect("b200_sxm.yaml parse must succeed");
assert_eq!(spec.data_dir, PathBuf::from("data/b200_sxm"));
assert_eq!(spec.gpu.mem_bw, 8_000_000_000_000.0);
assert_eq!(spec.gpu.mem_bw, 7_700_000_000_000.0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this change needed by the PR? Seems unrelated?

Comment on lines +346 to +347
// Validate against the loaded system spec so fixture calibration
// updates do not leave a stale duplicate constant in this test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's remove this block comment as the code is self-explanatory

/// to Python's `compile_engine` defaults. [`build_aic_engine`] remains available
/// for source compatibility with existing callers.
#[derive(Clone, Debug)]
pub struct AicEngineBuilder {

@simone-chen simone-chen Jul 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AicEngineBuilder mostly re-wraps the flat build_aic_engine(...) kwargs. Would a AicEngineBuildConfig struct + build_aic_engine(config) be easier to understand? Would like to hear @tedzhouhk's preference as well.

// Current (Option A)

AicEngineBuilder::new("Qwen/Qwen3-32B", "h200_sxm", BackendKind::Vllm)
    .tp_size(8)
    .attention_dp_size(4)
    .build()?;

// Proposed (Option B)

build_aic_engine(AicEngineBuildConfig {
    model_path: "Qwen/Qwen3-32B".into(),
    system: "h200_sxm".into(),
    backend: BackendKind::Vllm,
    tp_size: 8,
    attention_dp_size: 4,
    ..Default::default()
})?;

If we keep Option A, we should remove the pub function build_aic_engine and just keep the AicEngineBuilder::build instead:

impl AicEngineBuilder {
    pub fn build(self) -> Result<AicEngine, AicError> {
        let engine = compile_engine_from_flat(
            &self.model_path,
            &self.system,
            self.backend.as_str(),
            self.backend_version.as_deref(),
            self.tp_size,
            // ... rest from self
        )?;
        Ok(AicEngine::new(engine))
    }
}

Comment thread aic-core/API.md
Comment on lines +94 to +95
- compiled engine: `AicEngineBuilder`, `AicEngine`, `build_aic_engine`,
`AicError`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might need to change here too - some duplication can be removed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it really needed? 👀

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I might be missing something, but why do we put public-api-tests under root instead of keeping it under tests?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants