Skip to content
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

Small cpu_comparison "pythonic" improvements #601

Merged
merged 3 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ jobs:
# install requirements
# TODO(newling) make requirements.txt file
pip install numpy
source /opt/xilinx/xrt/setup.sh
python3 build_tools/ci/cpu_comparison/run_test.py test_aie_vs_cpu iree-install $PWD/llvm-aie

- name: Printing IR from aie2xclbin
Expand Down
Empty file.
13 changes: 7 additions & 6 deletions build_tools/ci/cpu_comparison/input_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,8 @@ def generate_inputs(filename, write_dir, seed):
line = line.strip()
tokens = line.split()
if len(tokens) > 2 and tokens[0] == "//":

# Lines of the form '// input 3x40xf32'
if tokens[1] == "input":

sub_tokens = tokens[2].split("x")
element_type = sub_tokens[-1]

Expand All @@ -192,7 +190,12 @@ def generate_inputs(filename, write_dir, seed):
bin_filename = os.path.join(
write_dir, name + "_input" + str(input_number) + ".bin"
)
input_args.append('--input="%s=@%s"' % (tokens[2], bin_filename))
if re.search(r"\s", str(bin_filename)):
raise RuntimeError(
f"input {tokens[2]}={bin_filename} has a space in the filename, which is not supported"
)

input_args.append(f"--input={tokens[2]}=@{bin_filename}")
# Each input has a distinct seed, based on its input number.
# This is to ensure that operands are not populated with the
# same values.
Expand Down Expand Up @@ -238,6 +241,4 @@ def generate_inputs(filename, write_dir, seed):
f"{func_num_inputs}"
)

command_flags = " ".join(input_args)
return command_flags

return input_args
Loading
Loading