126126# if you're not careful. Check this if you made some changes and the
127127# ASAN test is not working
128128if [[ " $BUILD_ENVIRONMENT " == * asan* ]]; then
129- export ASAN_OPTIONS=detect_leaks=0:symbolize=1:detect_stack_use_after_return=1 :strict_init_order=true:detect_odr_violation=1:detect_container_overflow=0
129+ export ASAN_OPTIONS=detect_leaks=0:symbolize=1:detect_stack_use_after_return=true :strict_init_order=true:detect_odr_violation=1:detect_container_overflow=0:check_initialization_order=true:debug=true
130130 export UBSAN_OPTIONS=print_stacktrace=1
131131 export PYTORCH_TEST_WITH_ASAN=1
132132 export PYTORCH_TEST_WITH_UBSAN=1
@@ -166,6 +166,8 @@ if [[ "$BUILD_ENVIRONMENT" == *asan* ]]; then
166166
167167 # TODO: get rid of the hardcoded path
168168 export LD_PRELOAD=/usr/lib/llvm-7/lib/clang/7.0.1/lib/linux/libclang_rt.asan-x86_64.so
169+ # Disable valgrind for asan
170+ export VALGRIND=OFF
169171 # Increase stack size, because ASAN red zones use more stack
170172 ulimit -s 81920
171173
@@ -312,7 +314,6 @@ test_perf_for_dashboard() {
312314 local suite=" $1 "
313315 shift
314316
315- local dtype=amp
316317 local backend=inductor
317318 local modes=()
318319 if [[ " $DASHBOARD_TAG " == * training-true* ]]; then
@@ -325,6 +326,11 @@ test_perf_for_dashboard() {
325326 local targets=(accuracy performance)
326327
327328 for mode in " ${modes[@]} " ; do
329+ if [[ " $mode " == " inference" ]]; then
330+ dtype=bfloat16
331+ elif [[ " $mode " == " training" ]]; then
332+ dtype=amp
333+ fi
328334 for target in " ${targets[@]} " ; do
329335 local target_flag=(" --${target} " )
330336 if [[ " $target " == " performance" ]]; then
@@ -430,7 +436,7 @@ test_dynamo_benchmark() {
430436 if [[ " ${TEST_CONFIG} " == * cpu_accuracy* ]]; then
431437 test_single_dynamo_benchmark " inference" " $suite " " $shard_id " --inference --float32 " $@ "
432438 else
433- test_single_dynamo_benchmark " inference" " $suite " " $shard_id " --inference --amp " $@ "
439+ test_single_dynamo_benchmark " inference" " $suite " " $shard_id " --inference --bfloat16 " $@ "
434440 test_single_dynamo_benchmark " training" " $suite " " $shard_id " --training --amp " $@ "
435441 fi
436442 fi
@@ -469,7 +475,7 @@ test_aten() {
469475 # Test ATen
470476 # The following test(s) of ATen have already been skipped by caffe2 in rocm environment:
471477 # scalar_tensor_test, basic, native_test
472- if [[ " $BUILD_ENVIRONMENT " != * asan * ]] && [[ " $BUILD_ENVIRONMENT " != * rocm* ]]; then
478+ if [[ " $BUILD_ENVIRONMENT " != * rocm* ]]; then
473479 echo " Running ATen tests with pytorch lib"
474480
475481 if [[ -n " $IN_WHEEL_TEST " ]]; then
@@ -669,51 +675,45 @@ test_rpc() {
669675}
670676
671677test_custom_backend () {
672- if [[ " $BUILD_ENVIRONMENT " != * asan* ]] ; then
673- echo " Testing custom backends"
674- CUSTOM_BACKEND_BUILD=" ${CUSTOM_TEST_ARTIFACT_BUILD_DIR} /custom-backend-build"
675- pushd test/custom_backend
676- cp -a " $CUSTOM_BACKEND_BUILD " build
677- # Run tests Python-side and export a lowered module.
678- python test_custom_backend.py -v
679- python backend.py --export-module-to=model.pt
680- # Run tests C++-side and load the exported lowered module.
681- build/test_custom_backend ./model.pt
682- rm -f ./model.pt
683- popd
684- assert_git_not_dirty
685- fi
678+ echo " Testing custom backends"
679+ CUSTOM_BACKEND_BUILD=" ${CUSTOM_TEST_ARTIFACT_BUILD_DIR} /custom-backend-build"
680+ pushd test/custom_backend
681+ cp -a " $CUSTOM_BACKEND_BUILD " build
682+ # Run tests Python-side and export a lowered module.
683+ python test_custom_backend.py -v
684+ python backend.py --export-module-to=model.pt
685+ # Run tests C++-side and load the exported lowered module.
686+ build/test_custom_backend ./model.pt
687+ rm -f ./model.pt
688+ popd
689+ assert_git_not_dirty
686690}
687691
688692test_custom_script_ops () {
689- if [[ " $BUILD_ENVIRONMENT " != * asan* ]] ; then
690- echo " Testing custom script operators"
691- CUSTOM_OP_BUILD=" ${CUSTOM_TEST_ARTIFACT_BUILD_DIR} /custom-op-build"
692- pushd test/custom_operator
693- cp -a " $CUSTOM_OP_BUILD " build
694- # Run tests Python-side and export a script module.
695- python test_custom_ops.py -v
696- python model.py --export-script-module=model.pt
697- # Run tests C++-side and load the exported script module.
698- build/test_custom_ops ./model.pt
699- popd
700- assert_git_not_dirty
701- fi
693+ echo " Testing custom script operators"
694+ CUSTOM_OP_BUILD=" ${CUSTOM_TEST_ARTIFACT_BUILD_DIR} /custom-op-build"
695+ pushd test/custom_operator
696+ cp -a " $CUSTOM_OP_BUILD " build
697+ # Run tests Python-side and export a script module.
698+ python test_custom_ops.py -v
699+ python model.py --export-script-module=model.pt
700+ # Run tests C++-side and load the exported script module.
701+ build/test_custom_ops ./model.pt
702+ popd
703+ assert_git_not_dirty
702704}
703705
704706test_jit_hooks () {
705- if [[ " $BUILD_ENVIRONMENT " != * asan* ]] ; then
706- echo " Testing jit hooks in cpp"
707- HOOK_BUILD=" ${CUSTOM_TEST_ARTIFACT_BUILD_DIR} /jit-hook-build"
708- pushd test/jit_hooks
709- cp -a " $HOOK_BUILD " build
710- # Run tests Python-side and export the script modules with hooks
711- python model.py --export-script-module=model
712- # Run tests C++-side and load the exported script modules
713- build/test_jit_hooks ./model
714- popd
715- assert_git_not_dirty
716- fi
707+ echo " Testing jit hooks in cpp"
708+ HOOK_BUILD=" ${CUSTOM_TEST_ARTIFACT_BUILD_DIR} /jit-hook-build"
709+ pushd test/jit_hooks
710+ cp -a " $HOOK_BUILD " build
711+ # Run tests Python-side and export the script modules with hooks
712+ python model.py --export-script-module=model
713+ # Run tests C++-side and load the exported script modules
714+ build/test_jit_hooks ./model
715+ popd
716+ assert_git_not_dirty
717717}
718718
719719test_torch_function_benchmark () {
@@ -923,7 +923,7 @@ test_cpp_extensions() {
923923
924924test_vec256 () {
925925 # This is to test vec256 instructions DEFAULT/AVX/AVX2 (platform dependent, some platforms might not support AVX/AVX2)
926- if [[ " $BUILD_ENVIRONMENT " != * asan * ]] && [[ " $BUILD_ENVIRONMENT " != * rocm* ]]; then
926+ if [[ " $BUILD_ENVIRONMENT " != * rocm* ]]; then
927927 echo " Testing vec256 instructions"
928928 mkdir -p test/test-reports/vec256
929929 pushd build/bin
0 commit comments