Fix hardcoded path bug + add CI for the hardware-independent surface#1
Merged
Conversation
test_blur.py wrote its before/after PNGs to a hardcoded /home/scott/npu-linux-kit/camera/... path, which only worked on the original author's machine. Write next to the script instead, using the same os.path.dirname(__file__) pattern the file already uses for sys.path. Still needs the real NPU + IRON toolchain to actually run (import aie.iron), so I can't execute this end to end here, but the path fix itself is a one-line, low-risk portability correction. Signed-off-by: Scott <scottbphone12@gmail.com>
Every module here is an application on top of the open-xdna NPU stack (IRON/mlir-aie + Peano + a real XDNA1 NPU), none of which exists on a GitHub-hosted runner. This CI covers what's left: - byte-compiles all of camera/*.py (syntax only) - installs requirements.txt (opencv-python-headless, onnxruntime, numpy, ml_dtypes, pyvirtualcam) in a clean venv, confirming the host-side deps resolve on Linux/x86_64 - runs each camera/*.py module and asserts it gets through all of its own host-side imports and fails only at "import aie.iron" (the NPU toolchain boundary) - any other failure is a real bug and fails CI I ran this exact sequence locally first: requirements.txt installs clean, and all six camera/*.py files (including test_blur.py after the path fix) fail only at the aie import, nothing earlier. This does not and cannot verify any effect actually running on the NPU, camera/kernels/blur3x3.cc compiling (needs the Peano AIE2 cross-compiler), or the measured FPS numbers in camera/README.md. Signed-off-by: Scott <scottbphone12@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix
camera/test_blur.pywrote its before/after PNGs to a hardcoded/home/scott/npu-linux-kit/camera/...path, which only works on the original machine. Changed it to write next to the script using theos.path.dirname(__file__)pattern the file already uses forsys.path. Still needs the real NPU + IRON toolchain to run end to end (import aie.iron), so I couldn't execute it, but the path fix is a one-line, low-risk portability correction.CI
Every module in this kit sits on top of the open-xdna NPU stack (IRON/mlir-aie + Peano + a real XDNA1 chip), none of which exists on a GitHub-hosted runner. This CI covers what's actually checkable:
camera/*.py(syntax only)requirements.txt(opencv-python-headless, onnxruntime, numpy, ml_dtypes, pyvirtualcam) in a clean venv - confirms the host-side deps resolve on Linux/x86_64camera/*.pymodule and checks it gets through all of its own host-side imports and fails only atimport aie.iron(the NPU-toolchain boundary). Any other failure mode is a real bug and fails CI.I ran this exact sequence locally first:
requirements.txtinstalls clean, and all sixcamera/*.pyfiles (includingtest_blur.pyafter the path fix) fail only at theaieimport, nothing earlier.What this does NOT verify (said explicitly in the workflow comments)
camera/kernels/blur3x3.cccompiling - needs the Peano AIE2 cross-compiler andaie_apiheaderscamera/README.mdTest plan
python -m compileall -q cameracleanpip install -r requirements.txtclean in a fresh venvcamera/*.pyfiles fail only atModuleNotFoundError: No module named 'aie', verified locally