1.5 KiB
1.5 KiB
KTC Local Patch Notes
This file records local changes made to ktc so future updates can be re-applied and re-tested.
2026-01-28: Prefer prebuild toolchain binaries when USE_PREBUILD is set
Why
- Toolchain binaries/scripts were hard-coded to
/workspace/libs_V2or/workspace/libs. - In this repo, we want to use
toolchain/prebuildwithout modifying those system paths.
Changes
-
Add
_resolve_compiler_paths()helper
File:ktc/toolchain.py- If
USE_PREBUILDexists and is a directory, uses:prebuild/gen_config.pyprebuild/batch_compileprebuild/kneron_nef_utilsprebuild/opt_compile(viaOPT_COMPILE_DIR)
- Otherwise falls back to
LIBS_V1_FOLDER/LIBS_V2_FOLDER.
- If
-
Use
_resolve_compiler_paths()in these functions:gen_config_for_single_model()→ usesgen_config.pyfrom resolved path and setsOPT_COMPILE_DIR.generate_batch_conf()→ usesgen_config.pyfrom resolved path.encrypt_compile()→ usesbatch_compile(both 520 and non-520 cases) andkneron_nef_utils(for 730).
Reapply checklist (if KTC updated)
- Re-add
_resolve_compiler_paths()helper toktc/toolchain.py. - Rewire the call sites listed above to use the helper.
Tests to run
pytest -s ./tests/workers/test_bie_core.py
pytest -s ./tests/workers/test_nef_core.py
Notes
kneron_nef_utilsmust exist intoolchain/prebuild/. If missing, copy it fromlibs_V2/compiler/.