8 Commits

Author SHA1 Message Date
ed327876f5 [codemod] c10:optional -> std::optional (#126135)
Generated by running the following from PyTorch root:
```
find . -regex ".*\.\(cpp\|h\|cu\|hpp\|cc\|cxx\)$" | grep -v "build/" | xargs -n 50 -P 4 perl -pi -e 's/c10::optional/std::optional/'
```

`c10::optional` is just an alias for `std::optional`. This removes usages of that alias in preparation for eliminating it entirely.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/126135
Approved by: https://github.com/Skylion007, https://github.com/malfet, https://github.com/albanD, https://github.com/aaronenyeshi
2024-05-14 19:35:51 +00:00
cyy
5d5990fc49 Remaining replacement of c10::stoi with std::stoi (#109482)
PR #109179 replaced c10::stoi with std::stoi. However, there were some files forgotten to change. This patch fixes them.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/109482
Approved by: https://github.com/vfdev-5, https://github.com/Skylion007
2023-09-18 16:05:09 +00:00
cb630c775e Add multithreading test to model compare binary (#80958)
This diff adds a option (`--nthreads`) which will launch the specified number of threads to load the models execute the correctness check on them.

Differential Revision: [D37465661](https://our.internmc.facebook.com/intern/diff/D37465661/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80958
Approved by: https://github.com/manuelcandales
2022-07-06 21:02:04 +00:00
f101070587 Small improvements to compare_models_torch binary (#65171)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65171

Add the model comparison binary to BUCK, and also add some quality of life features such as controlling the input range.

Test Plan:
```
# Build the binary
cd ~/fbsource
buck build -c ndk.custom_libcxx=false -c pt.enable_qpl=0 //xplat/caffe2:ptmobile_compareAndroid\#android-arm64 --show-ou
# Push it to the device
adb push buck-out/gen/xplat/caffe2/ptmobile_compareAndroid\#android-arm64 /data/local/tmp/compare_models

# Run the benchmark binary
BENCH_CMD="/data/local/tmp/compare_models"
BENCH_CMD+=" --model=$PATH_TO_MODEL"
BENCH_CMD+=" --refmodel=$PATH_TO_REFERENCE_MODEL"
BENCH_CMD+=" --input_type=float --input_dims=$MODEL_INPUT_SIZE"
BENCH_CMD+=" --iter=100"
BENCH_CMD+=" --tolerance 1e-5"

```

Reviewed By: beback4u

Differential Revision: D30371322

fbshipit-source-id: 5e520aaf119c90985a1d5a135f76e4057148333b
2021-09-17 08:32:45 -07:00
3a0801f960 [skip ci] Fix "arugment" typos (#61459)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/61455.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/61459

Reviewed By: soulitzer

Differential Revision: D29636559

Pulled By: samestep

fbshipit-source-id: 9ad65265c0491d9e81bb303abe3a07c6843bfa4a
2021-07-15 15:20:18 -07:00
24c904951c Replace AutoNonVariableTypeMode with InferenceMode in fbcode. (#55114)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55114

Test Plan: CI

Reviewed By: ezyang, bhosmer

Differential Revision: D27472768

fbshipit-source-id: 76f17ef7de40f6e04e2968f8958027b5f93e1c0c
2021-04-02 11:45:53 -07:00
c2558b4b61 [vulkan] Add nonVarTypeModeGuard to vulkan tests and speed_benchmark_torch (#52535)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/52535

Test Plan: Imported from OSS

Reviewed By: ailzhang

Differential Revision: D26580994

Pulled By: SS-JIA

fbshipit-source-id: 94f091432265cf6607b73c34846c07273d47c70b
2021-02-25 14:23:40 -08:00
cc1c3063c5 Add test binary to compare torch model outputs (#47933)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47933

Test Plan: Imported from OSS

Reviewed By: IvanKobzarev

Differential Revision: D25309199

Pulled By: SS-JIA

fbshipit-source-id: adc3fc7db33c251f6b661916265b86b7b8c68fc2
2020-12-03 15:29:56 -08:00