Commit Graph

12 Commits

Author SHA1 Message Date
Digant Desai
b2054d3025 Prepare for an update to the XNNPACK submodule (#72642)
Summary:
- Target Sha1: ae108ef49aa5623b896fc93d4298c49d1750d9ba
- Make USE_XNNPACK a dependent option on cmake minimum version 3.12
- Print USE_XNNPACK under cmake options summary, and print the
  availability from collet_env.py
- Skip XNNPACK based tests when XNNPACK is not available
    - Add SkipIfNoXNNPACK wrapper to skip tests
- Update cmake version for xenial-py3.7-gcc5.4 image to 3.12.4
    - This is required for the backwards compatibility test.
      The PyTorch op schema is XNNPACK dependent. See,
      aten/src/ATen/native/xnnpack/RegisterOpContextClass.cpp for
      example. The nightly version is assumed to have USE_XNNPACK=ON,
      so with this change we ensure that the test build can also
      have XNNPACK.
- HACK: skipping test_xnnpack_integration tests on ROCM

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

Reviewed By: kimishpatel

Differential Revision: D34456794

Pulled By: digantdesai

fbshipit-source-id: 85dbfe0211de7846d8a84321b14fdb061cd6c037
(cherry picked from commit 6cf48e7b64d6979962d701b5d493998262cc8bfa)
2022-02-25 00:39:15 +00:00
Jane Xu
a4a6d056e6 Add ownership to more edge tests (#67859)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/66232

This should be the last immediate task. I anticipate test ownership will change overtime but this is the last big thing to close it out

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

Reviewed By: soulitzer

Differential Revision: D32210534

Pulled By: janeyx99

fbshipit-source-id: 7fd835d87d9d35d49ec49de1fcfa29b085133e99
2021-11-05 11:01:16 -07:00
Jane Xu
6259601c8a Set test owners for tests with unknown owners (#67552)
Summary:
Action following https://github.com/pytorch/pytorch/issues/66232

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

Reviewed By: jbschlosser

Differential Revision: D32028248

Pulled By: janeyx99

fbshipit-source-id: a006f7026288b7126dba58b31cac28e10ce0fed6
2021-10-29 12:42:01 -07:00
David Reiss
e1d963e8fc model_dump: Fix memory computation when both constants and data tensors are present (#66006)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66006

Previously, this was resulting in a key collision and a crash.
ghstack-source-id: 139342089

Test Plan: Ran webdriver test locally.

Reviewed By: dhruvbird

Differential Revision: D31281092

fbshipit-source-id: f31311726c681d6d7e0504ff8e84c888af9054f0
2021-10-01 16:31:06 -07:00
David Reiss
23caeb3f71 model_dump: Add a helper to produce html with a single call (#66005)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66005

ghstack-source-id: 139342091

Test Plan: Unit test, and used in a notebook.

Reviewed By: dhruvbird

Differential Revision: D31281091

fbshipit-source-id: 1e4d0713b9796a3d182de9e676c3b3c3b1610d6e
2021-10-01 16:29:43 -07:00
Vasiliy Kuznetsov
227e37dd39 pytorch quantization ao migration phase 2: caffe2/test (#65832)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65832

Renames `torch.quantization` to `torch.ao.quantization` in `caffe2/test`
folder.

```
find caffe2/test/ -type f -name "*.py" -print0 | xargs -0 sed -i "s/torch\.quantization/torch.ao.quantization/g"
HG: manually revert the files testing this migration
hg revert caffe2/test/quantization/ao_migration/common.py
hg revert caffe2/test/quantization/ao_migration/test_ao_migration.py
```

Test Plan: CI

Reviewed By: z-a-f

Differential Revision: D31275754

fbshipit-source-id: 4ed54a74525634feb0f47a26d071102e19c30049
2021-10-01 06:26:30 -07:00
Shen Li
1022443168 Revert D30279364: [codemod][lint][fbcode/c*] Enable BLACK by default
Test Plan: revert-hammer

Differential Revision:
D30279364 (b004307252)

Original commit changeset: c1ed77dfe43a

fbshipit-source-id: eab50857675c51e0088391af06ec0ecb14e2347e
2021-08-12 11:45:01 -07:00
Zsolt Dollenstein
b004307252 [codemod][lint][fbcode/c*] Enable BLACK by default
Test Plan: manual inspection & sandcastle

Reviewed By: zertosh

Differential Revision: D30279364

fbshipit-source-id: c1ed77dfe43a3bde358f92737cd5535ae5d13c9a
2021-08-12 10:58:35 -07:00
David Reiss
7fdc5f9e08 model_dump: Fix non-counting and double-counting bugs in tensor memory (#60702)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60702

- Instead of traversing and counting all tensor memory, collect a map
  from storage key to storage info while traversing.  Add up sizes at
  the end to avoid double counting.
- Count tensor memory from constants as well.

Test Plan: Ran webdriver test.

Reviewed By: dhruvbird

Differential Revision: D29380396

Pulled By: dreiss

fbshipit-source-id: 6d0fd66f677fe23c851aa218387aa4dc59502b1e
2021-07-10 15:16:34 -07:00
David Reiss
158d351517 model_dump: Add webdriver test (#60701)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60701

The unit test previously only tested that the dump could complete
successfully.  It was not able to verify that any JS worked properly.
Now we can test the JS as long as webdriver is installed.

Tweaked the implementation of Hider a bit to make it easier for tests to
find and open them.

I disabled the tests by default since I don't want to deal with
webdriver in CI.  Enable them with the environment variable
RUN_WEBDRIVER=1.

We could make the tests use headless mode, but it's kind of fun to watch
them run.

Add a test to verify that tensor memory computation is working for the
simple model.

Test Plan: Ran the test.

Reviewed By: dhruvbird

Differential Revision: D29380398

Pulled By: dreiss

fbshipit-source-id: f19d0b05d79ad5a8231e85422976f1889e021c89
2021-07-10 15:16:32 -07:00
David Reiss
e292f34def model_dump: Make stdout argument for main a keyword-only argument (#60699)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60699

Also add a unit test for main, which brings the test coverage up to
~98%.  Also factor out the "needs importlib.resources" check into a
function for easier reuse.

Test Plan: CI

Reviewed By: dhruvbird

Differential Revision: D29380397

Pulled By: dreiss

fbshipit-source-id: bba16da85bf7bfb4370308e38c844694d01b47eb
2021-07-10 15:16:29 -07:00
David Reiss
89377e3e45 model_dump tool for model inspection (#56868)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56868

See __init__.py for a summary of the tool.
The following sections are present in this initial version
- Model Size.  Show the total model size, as well as a breakdown by
  stored files, compressed files, and zip overhead.  (I expect this
  breakdown to be a bit more useful once data.pkl is compressed.)
- Model Structure.  This is basically the output of
  `show_pickle(data.pkl)`, but as a hierarchical structure.
  Some structures cause this view to crash right now, but it can be
  improved incrementally.
- Zip Contents.  This is basically the output of `zipinfo -l`.
- Code.  This is the TorchScript code.  It's integrated with a blame
  window at the bottom, so you can click "Blame Code", then click a bit
  of code to see where it came from (based on the debug_pkl).  This
  currently doesn't render properly if debug_pkl is missing or
  incomplete.
- Extra files (JSON).  JSON dumps of each json file under /extra/, up to
  a size limit.
- Extra Pickles.  For each .pkl file in the model, we safely unpickle it
  with `show_pickle`, then render it with `pprint` and include it here
  if the size is not too large.  We aren't able to install the pprint
  hack that thw show_pickle CLI uses, so we get one-line rendering for
  custom objects, which is not very useful.  Built-in types look fine,
  though.  In particular, bytecode.pkl seems to look fine (and we
  hard-code that file to ignore the size limit).

I'm checking in the JS dependencies to avoid a network dependency at
runtime.  They were retrieved from the following URLS, then passed
through a JS minifier:
  https://unpkg.com/htm@3.0.4/dist/htm.module.js?module
  https://unpkg.com/preact@10.5.13/dist/preact.module.js?module

Test Plan:
Manually ran on a few models I had lying around.
Mostly tested in Chrome, but I also poked around in Firefox.

Reviewed By: dhruvbird

Differential Revision: D28020849

Pulled By: dreiss

fbshipit-source-id: 421c30ed7ca55244e9fda1a03b8aab830466536d
2021-04-28 07:33:10 -07:00