Problem
cargo build -p apr-cli --no-default-features --features training fails with 40 errors because apr-cli code imports realizar types without #[cfg(feature = "inference")] guards.
This blocks aarch64 builds on NVIDIA GB10 (gx10) where we want CPU/GPU training via entrenar without the full inference stack.
Root Cause
apr-cli's Cargo.toml already has realizar as optional (inference feature), but ~25 source files import realizar::* unconditionally. The TODO at line 86 acknowledges this:
# Note: cuda/gpu features hardcoded here because apr-cli code has ungated CUDA imports.
# TODO: Gate all CUDA code in apr-cli with #[cfg(feature = "cuda")] then remove from here.
Affected Files (25)
bench, cbtop, chat, chat_generate_session, compare_hf, comparison, data, diff_benchmark_report, distill, finetune, forward_error, golden_output, import, output_verification, profile_pct_change_classify, ptx_explain, publish, pull_remove_resolve_model, qa, run, safetensors, showcase/demo, showcase/pipeline, speedup, validate
Error Categories
| Error |
Count |
Fix |
realizar not found |
5 |
#[cfg(feature = "inference")] |
results_a/b not found |
11 |
Gate comparison code behind inference |
ChatSession field errors |
6 |
Gate chat code behind inference |
ureq method errors |
2 |
Gate HF hub code behind hf-hub |
| Type annotation cascades |
8 |
Resolved by above fixes |
hf_hub import |
1 |
#[cfg(feature = "hf-hub")] |
| safetensors functions |
5 |
Gate behind safetensors-compare |
Expected Outcome
cargo build -p apr-cli --no-default-features --features training compiles on aarch64 and x86_64, producing an apr binary with apr train apply support.
Verification
# On gx10 (aarch64):
cargo build --release -p apr-cli --no-default-features --features training
./target/release/apr train apply --task pretrain --config configs/train/pretrain-350m-cuda-test.yaml
Problem
cargo build -p apr-cli --no-default-features --features trainingfails with 40 errors because apr-cli code importsrealizartypes without#[cfg(feature = "inference")]guards.This blocks aarch64 builds on NVIDIA GB10 (gx10) where we want CPU/GPU training via entrenar without the full inference stack.
Root Cause
apr-cli's Cargo.toml already has
realizaras optional (inferencefeature), but ~25 source files importrealizar::*unconditionally. The TODO at line 86 acknowledges this:Affected Files (25)
bench, cbtop, chat, chat_generate_session, compare_hf, comparison, data, diff_benchmark_report, distill, finetune, forward_error, golden_output, import, output_verification, profile_pct_change_classify, ptx_explain, publish, pull_remove_resolve_model, qa, run, safetensors, showcase/demo, showcase/pipeline, speedup, validate
Error Categories
realizarnot found#[cfg(feature = "inference")]results_a/bnot foundChatSessionfield errorsureqmethod errorshf_hubimport#[cfg(feature = "hf-hub")]Expected Outcome
cargo build -p apr-cli --no-default-features --features trainingcompiles on aarch64 and x86_64, producing anaprbinary withapr train applysupport.Verification
# On gx10 (aarch64): cargo build --release -p apr-cli --no-default-features --features training ./target/release/apr train apply --task pretrain --config configs/train/pretrain-350m-cuda-test.yaml