This is an archive of the discontinued LLVM Phabricator instance.

[mlgo][aot] requrie the model is autogenerated for test determinism
ClosedPublic

Authored by mtrofin on Oct 13 2021, 10:38 AM.

Details

Summary

The tests that exercise the 'release' mode, where the model is AOT-ed,
check the output has certain properties, to validate that, indeed, a
different policy from the default one was exercised. For determinism, we
can't reliably check that output for an arbitrary learned policy, since
it could be that policy happens to mimic the default one in that
particular case.

This patch adds a requirement that those tests run only when the model
is autogenerated (e.g. on build bots).

Diff Detail

Event Timeline

mtrofin created this revision.Oct 13 2021, 10:38 AM
mtrofin requested review of this revision.Oct 13 2021, 10:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2021, 10:38 AM
phosek added inline comments.Oct 13 2021, 10:45 AM
llvm/test/lit.site.cfg.py.in
57

llvm_canonicalize_cmake_booleans replaces every variable with 0 or 1 (depending on whether the variable evaluates to true or not in CMake) so this condition will always be false.

I'd probably use a new variable, for example LLVM_INLINER_MODEL_AUTOGENERATED and set it like this:

set(LLVM_INLINER_MODEL_AUTOGENERATED 0)
if(LLVM_INLINER_MODEL_PATH)
  string(TOUPPER ${LLVM_INLINER_MODEL_PATH} uppercase_LLVM_INLINER_MODEL_PATH)
  if(uppercase_LLVM_INLINER_MODEL_PATH STREQUAL "AUTOGENERATED")
    set(LLVM_INLINER_MODEL_AUTOGENERATED 1)
  endif()
endif()

Then I'd use @LLVM_INLINER_MODEL_AUTOGENERATED@ inside lit.site.cfg.py.in.

phosek accepted this revision.Oct 13 2021, 1:04 PM

LGTM

This revision is now accepted and ready to land.Oct 13 2021, 1:04 PM