Skip to content

Arm backend: Allow for TOSA tests to run without ethos-u-vela #8732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion backends/arm/arm_vela.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
from typing import List

import numpy as np
from ethosu.vela import vela # type: ignore

try:
from ethosu.vela import vela # type: ignore

has_vela = True
except ImportError:
has_vela = False


# Pack either input or output tensor block, compose the related arrays into
Expand Down Expand Up @@ -45,6 +51,11 @@ def vela_compile(
"""
Compile a TOSA graph to a binary stream for ArmBackendEthosU using Vela.
"""
if not has_vela:
raise RuntimeError(
"ethos-u-vela pip package couldn't be imported. Make sure it's installed!"
)

with tempfile.TemporaryDirectory() as tmpdir:
tosaname = "out.tosa"
tosa_path = os.path.join(tmpdir, tosaname)
Expand Down
Loading