Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
svuckovicTT committed Dec 27, 2024
1 parent 09d1349 commit 0e0a42c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ jobs:
{runs-on: n300, enable_perf: OFF, emitc: OFF, name: "run", ttrt_flags: "--non-zero"},
{runs-on: n300, enable_perf: ON, emitc: OFF, name: "perf"},
]
name: "run-tests (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.name }})"
name: "run-tests (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.emitc }}, ${{ matrix.build.name }})"

runs-on:
- in-service
Expand All @@ -296,7 +296,7 @@ jobs:
id: strings
shell: bash
env:
job-name: "run-tests (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.name }})"
job-name: "run-tests (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.emitc }}, ${{ matrix.build.name }})"
run: |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
Expand Down
43 changes: 24 additions & 19 deletions runtime/tools/python/ttrt/common/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,33 +558,38 @@ def _execute(binaries):
if event is not None:
ttrt.runtime.wait(event)

# Compare to EmitC
if is_emitc_testing_requested:
fwd_func_name = program.program["name"]
fwd_func_name_len = len(fwd_func_name)
fwd_func_sym = f"_Z{fwd_func_name_len}{fwd_func_name}St6vectorIN2tt8tt_metal6TensorESaIS2_EEPNS1_2v06DeviceE"
emitc_outs = ttrt.runtime.run_so_program(
emitc_dylib_handle,
fwd_func_sym,
inputs,
device,
)
self.logging.debug(
f"got emitc outputs for program={program_index}"
)

all_tensors_match = ttrt.runtime.compare_outs(
total_outputs[0], emitc_outs
)

if not all_tensors_match:
self.logging.error(
"Failed: TTRT and EmitC outputs do not match!"
for loop in range(self["--loops"]):
emitc_outs = ttrt.runtime.run_so_program(
emitc_dylib_handle,
fwd_func_sym,
total_inputs[loop],
device,
)
self.logging.debug(
f"got emitc outputs for program_index={program_index}, loop={loop}"
)
self.logging.error(total_outputs[0], emitc_outs)
raise Exception(
"Failed: TTRT and EmitC outputs do not match!"

all_tensors_match = ttrt.runtime.compare_outs(
total_outputs[0], emitc_outs
)

if not all_tensors_match:
self.logging.error(
"Failed: TTRT and EmitC outputs do not match! program_index={program_index}, loop={loop}"
)
self.logging.error(
total_outputs[loop], emitc_outs
)
raise Exception(
"Failed: TTRT and EmitC outputs do not match! program_index={program_index}, loop={loop}"
)

if self["--identity"]:
self.logging.debug(
f"checking identity with rtol={self['--rtol']} and atol={self['--atol']}"
Expand Down

0 comments on commit 0e0a42c

Please sign in to comment.