@@ -441,6 +441,24 @@ if [[ -n "${extra_defs}" ]]; then
441441 exit 1
442442fi
443443
444+ # ET_CHECK_MSG and ET_LOG hand their text to the core archive's vlogf, so an
445+ # archive compiled with logging off turns every runtime failure in the packaged
446+ # runner into a bare exit code with no output at all. Prove the runner can still
447+ # say why it failed, on a path that needs neither a GPU nor a valid model.
448+ diagnostic_log=" ${verify_root} /packaged_runner_diagnostic.log"
449+ if " ${packaged_runner} " \
450+ --model_path=" ${verify_root} /no-such-model.pte" > " ${diagnostic_log} " 2>&1 ; then
451+ echo " Packaged runner exited 0 on a missing model file" >&2
452+ exit 1
453+ fi
454+ if ! grep -q " FileDataLoader::from" " ${diagnostic_log} " ; then
455+ echo " Packaged runner gave no diagnostic for a missing model file." >&2
456+ echo " ET_LOG_ENABLED likely disagrees between libexecutorch_core.a and the" >&2
457+ echo " Bazel targets that call into it. Output was:" >&2
458+ cat " ${diagnostic_log} " >&2
459+ exit 1
460+ fi
461+
444462" ${runner_path} " \
445463 --model_path=" ${model_path} " \
446464 --num_runs=1 2>&1 | tee " ${runner_log} "
@@ -454,9 +472,19 @@ packaged_runner_log="${verify_root}/packaged_runner.log"
454472# Assert both precisely. Matching only "shape=" accepts any shape, and matching one
455473# 2.0000 anywhere on the values line accepts a line of wrong numbers that happens to
456474# contain one right one, so neither catches a stream-ordering regression returning
457- # stale or partial output. ET_LOG output is not part of the packaged runner contract
458- # and may be compiled out, so nothing here depends on it .
475+ # stale or partial output. Both lines come from fprintf in the runner, so these
476+ # assertions hold whatever ET_LOG_ENABLED is set to .
459477for _log in " ${runner_log} " " ${packaged_runner_log} " ; do
478+ # A right answer produced entirely on the host would not prove much here: the
479+ # program is delegated to TensorRT, so at least one planned buffer has to be
480+ # served by a registered CUDA DeviceAllocator. Pin that, otherwise a model or
481+ # a planning change could quietly turn this into a CPU-only test.
482+ if ! grep -q ' planned buffer\[[0-9]*\] = [0-9]* bytes on device_type 1' " ${_log} " ; then
483+ echo " No CUDA planned buffer was allocated in ${_log} :" >&2
484+ grep ' planned buffer' " ${_log} " >&2 || echo " no planned buffer line at all" >&2
485+ exit 1
486+ fi
487+
460488 if ! grep -q ' output\[0\] shape=\[2,3,4,4\]' " ${_log} " ; then
461489 echo " Unexpected output shape in ${_log} :" >&2
462490 grep ' output\[0\] shape=' " ${_log} " >&2 || echo " no shape line at all" >&2
0 commit comments