pytorch/caffe2/python
Yun Wang (Speech) 4130e4f284 [hypothesis==6.70.1] Fix more test errors (#98685)
Summary:
This diff fixes more test failures (T150117218) caused by upgrading the "hypothesis" library to 6.70.1 (D44523679).

# //caffe2/caffe2/python:hypothesis_test
This test generates float numbers and filters out those whose absolute values are less than 1e-2.
It is a known issue of the new version of "hypothesis" that it generates zeros or floats with small absolute values too often:
https://github.com/HypothesisWorks/hypothesis/issues/3603
I'm circumventing this issue by suppressing the health check `filter_too_much`.

# //caffe2/caffe2/quantization/server:resize_nearest_dnnlowp_op_test
All arithmetic should be done in float32 when calculating the reference, since the network being tested uses float32 everywhere.
Mixing float32, float64 or even integers will result in intermediate values in float64.
The different precision may cause off-by-1 errors when converting to integer.

Test Plan:
Run all the tests in both "dev" and "opt" modes:
```
for mode in dev opt; do
  buck2 test mode/$mode //caffe2/caffe2/python:hypothesis_test -- --run-disabled
  buck2 test mode/$mode //caffe2/caffe2/quantization/server:resize_nearest_dnnlowp_op_test -- --run-disabled
  buck2 test mode/$mode //caffe2/caffe2/fb/layers/tests:tum_history_test -- --run-disabled
  buck2 test mode/$mode //caffe2/caffe2/fb/dper/layer_models/tests:nn_ops_test -- --run-disabled
  buck2 test mode/$mode //caffe2/caffe2/fb/metrics:metrics_test -- --run-disabled
  buck2 test mode/$mode //deeplearning/numeric_suite/toolkit/test:net_transform_test -- --run-disabled
  buck2 test mode/$mode //f3/type_system:tests -- --run-disabled
done
```

**NOTE:** In the first test (`//caffe2/caffe2/python:hypothesis_test`), the two methods `test_constant_fill_from_tensor` and `test_recurrent` would crash.
But these crash on hypothesis 5.49.0, too, so I'm leaving them alone.

Differential Revision: D44812706

Pull Request resolved: https://github.com/pytorch/pytorch/pull/98685
Approved by: https://github.com/malfet
2023-04-11 19:07:55 +00:00
..
benchmarks
docs [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
examples [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
fakelowp
helpers
ideep
layers [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
mint
mkl
modeling [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
models [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
onnx [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
operator_test [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
predictor [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
rnn
serialized_test [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
test
trt [BE] Get rid of six in caffe2 code (#93956) 2023-02-02 22:13:37 +00:00
__init__.py Revert "Upgrade NVTX to NVTX3 (#90689)" 2023-03-24 18:16:06 +00:00
_import_c_extension.py
_import_c_extension.pyi
allcompare_test.py
attention.py
benchmark_generator.py
binarysize.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
brew.py
brew_test.py
build.py
cached_reader.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
caffe_translator.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
caffe_translator_test.py
checkpoint.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
checkpoint_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
clean_workspace_test.py extract out the clean workspace test to its own file (#88682) 2022-11-09 13:48:57 +00:00
CMakeLists.txt Move workspace related functions to separate file (#87651) 2022-10-29 04:52:01 +00:00
cnn.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
context.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
context.pyi
context_test.py
control.py [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
control_ops_grad.py
control_ops_grad_test.py
control_ops_util.py
control_test.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
convert.py
convert_test.py
convnet_benchmarks.py
convnet_benchmarks_test.py
core.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
core_gradients_test.py
core_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
crf.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
crf_predict.py
crf_viterbi_test.py
data_parallel_model.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
data_parallel_model_test.py [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
data_workers.py
data_workers_test.py
dataio.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
dataio_test.py
dataset.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
db_file_reader.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
db_test.py
device_checker.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
dlpack.h Add DLPack support for XPU backend by mapping to kDLOneAPI in DLPack … (#94968) 2023-03-30 04:32:15 +00:00
dyndep.py
embedding_generation_benchmark.py
experiment_util.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
extension_loader.py
fakefp16_transform_lib.py
filler_test.py
functional.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
functional_test.py
fused_8bit_rowwise_conversion_ops_test.py Fix fused_8bit_rowwise_conversion_ops_test (#98183) 2023-04-04 16:06:13 +00:00
gradient_check_test.py
gradient_checker.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
gru_cell.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
hip_test_util.py
hsm_util.py
hypothesis_test.py [hypothesis==6.70.1] Fix more test errors (#98685) 2023-04-11 19:07:55 +00:00
hypothesis_test_util.py
ideep_test_util.py
layer_model_helper.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
layer_model_instantiator.py
layer_parameter_sharing_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
layer_test_util.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
layers_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
lazy.py
lazy_dyndep.py
lazy_dyndep_test.py
lengths_reducer_fused_8bit_rowwise_ops_test.py
lengths_reducer_rowwise_8bit_ops_test.py
lstm_benchmark.py
memonger.py [BE]: Merge startswith calls - rule PIE810 (#96754) 2023-03-14 22:05:20 +00:00
memonger_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
mkl_test_util.py
model_device_test.py
model_helper.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
model_helper_test.py
modifier_context.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
mpi_python.cc
muji.py
muji_test.py
net_builder.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
net_builder_test.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
net_drawer.py [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
net_printer.py Fix usages of contextmanager without finally (#96170) 2023-03-08 20:59:27 +00:00
net_printer_test.py
nomnigraph.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
nomnigraph_test.py
nomnigraph_transformations.py
nomnigraph_transformations_test.py
normalizer.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
normalizer_context.py
normalizer_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
numa_benchmark.py
numa_test.py
observer_test.py
operator_fp_exceptions_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
optimizer.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
optimizer_context.py
optimizer_test.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
optimizer_test_util.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
parallel_workers.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
parallel_workers_test.py
parallelize_bmuf_distributed_test.py
pipeline.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
pipeline_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
predictor_constants.py
pybind_state.cc remove dead torch_pb.h library (#97599) 2023-03-28 00:55:17 +00:00
pybind_state.h [caffe2] Fix pybind11 native python link error (#92325) 2023-01-26 02:33:17 +00:00
pybind_state_dlpack.cc
pybind_state_dlpack.h
pybind_state_gpu.cc
pybind_state_hip.cc
pybind_state_ideep.cc
pybind_state_int8.cc
pybind_state_nomni.cc
pybind_state_registry.cc
pybind_state_registry.h
pybind_workspace.cc [caffe2] Fix pybind11 native python link error (#92325) 2023-01-26 02:33:17 +00:00
pybind_workspace.h [caffe2] Fix pybind11 native python link error (#92325) 2023-01-26 02:33:17 +00:00
python_op_test.py
queue_util.py
record_queue.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
recurrent.py [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
regularizer.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
regularizer_context.py
regularizer_test.py
rnn_cell.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
schema.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
schema_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
scope.py
scope_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
session.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
session_test.py
sparse_to_dense_mask_test.py
sparse_to_dense_test.py
task.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00
task_test.py
test_util.py
text_file_reader.py
timeout_guard.py [BE] Get rid of future (#92596) 2023-01-19 08:46:50 +00:00
toy_regression_test.py
transformations.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
transformations_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
tt_core.py
tt_core_test.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
utils.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
utils_test.py
visualize.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
workspace.py [blob inspector] free memory from workspace for di blobs post stats (#95064) 2023-02-19 05:05:35 +00:00
workspace_test.py [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00