Skip to content

Conversation

datagero
Copy link
Contributor

@datagero datagero commented Jul 9, 2024

Copy link

pytorch-bot bot commented Jul 9, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/130320

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 2cb35d4 with merge base ceedee2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Contributor

@oulgen oulgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test case showing that the behavior is same between eager and dynamo

Add one for when class defines __str__ and another when it does not

@datagero
Copy link
Contributor Author

datagero commented Jul 9, 2024

@oulgen tests added in tests/dynamo/test_functions.py::DefaultTests

Copy link
Contributor

@oulgen oulgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@datagero
Copy link
Contributor Author

datagero commented Jul 9, 2024

@oulgen Thanks - Do I need to fix the failed checks? lint would be straigthforward but not so sure of the rest which appear unrelated

@oulgen
Copy link
Contributor

oulgen commented Jul 9, 2024

You won't be able to land your changes until the CI is completely green. If you don't think that these breakages are due to your change, you can rebase on top of viable/strict so trunk is clean

datagero and others added 17 commits July 9, 2024 20:06
Some functions used by Caffe2 were removed along with some outdated checks. Follows pytorch#130006.

Pull Request resolved: pytorch#130322
Approved by: https://github.com/r-barnes
…30271)

Afaict the previous check was too strict. Removing it passes all the
mutation tests (mutation checks happen via the TensorVariable's mutable_local).

Test Plan:
- tests

Pull Request resolved: pytorch#130271
Approved by: https://github.com/Chillee, https://github.com/ydwu4
ghstack dependencies: pytorch#130255, pytorch#130268
- Add AMD support for int4 kernel
  - Only supports CDNA2 and CDNA3 gpus for now
  - Uses `mfma_f32_16x16x16bf16` instruction for matrix multiply
  - Uses `v_and_or_b32` instruction and `__hfma2` instrinsic for unpacking bf16 values
  - Enable hipify for `__nv_bfloat16` and `__nv_bfloat162` data types
- Enable int4 unit tests for CDNA2 and CDNA3 AMD gpus
- Fix torchscript issues due to hipify for `__nv_bfloat16` type
  - TorchScript has its own implementation for bfloat16 type
    - Implemented in `__nv_bloat16` structure at [resource_strings.h](https://github.com/pytorch/pytorch/blob/main/torch/csrc/jit/codegen/fuser/cuda/resource_strings.h)
    - So, we shouldn't hipify any reference of `__nv_bfloat16` in the torchscript implementation
    - Hence moved the `__nv_bfloat16` direct references in `codegen.cpp` and `cuda_codegen.cpp` to `resource_strings.h` which is already exempted from hipify

Fixes pytorch#124699
Fixes meta-pytorch/gpt-fast/issues/154

Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
Pull Request resolved: pytorch#129710
Approved by: https://github.com/malfet
As title, patch the dtype in torch.fx.graph
Pull Request resolved: pytorch#130339
Approved by: https://github.com/angelayi
Fixes pytorch#130241

that is a reopen pr of pytorch#130244, for possibly fixing the failed job
Pull Request resolved: pytorch#130305
Approved by: https://github.com/Skylion007
This adds a `_run_handler` method that will invoke a specific handler.

Test plan:

```
python test/distributed/elastic/test_control_plane.py
```

Pull Request resolved: pytorch#130149
Approved by: https://github.com/kurman, https://github.com/c-p-i-o
…128599)"

This reverts commit 940e447.

Reverted pytorch#128599 on behalf of https://github.com/izaitsevfb due to breaking internal APS tests, see D59498864 ([comment](pytorch#128599 (comment)))
…odes) (pytorch#130064)

We add torch.library.Library._register_torch_dispatch_rule. Here, a user
can provide us a specific rule to run for a specific
(torch_dispatch_class, operator) pair. The motivation is that a user
might want to extend a subclass/mode but may not have access to the
source code of the subclass/mode.

I'll make this public in a follow-up PR if we think the approach and API
is good.

Keep in mind that many subclasses will likely deliver their own open
registration solution (DTensor has register_sharding_prop_rule and NJT
has register_jagged_op); _register_torch_dispatch_rule is meant as a
catch-all open registration mechanism for when the subclass hasn't
provided anything more specific.

Test Plan:
- new tests
Pull Request resolved: pytorch#130064
Approved by: https://github.com/albanD
…0261)

This is the API for defining the interaction between a torch_dispatch
class and a custom op. Taking API bikeshedding.

Test Plan:
- new tests
Pull Request resolved: pytorch#130261
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#130064
…ces (pytorch#130315)

Summary: This diff fixes a bug, where all record_annotations will save a TraceEntry to each of the device_traces. Instead, we should only save annotations to the current device_trace that is being called by the thread calling the native allocator's recordAnnotation.

Test Plan: CI and ran workloads on MVAI WPR FBR.

Reviewed By: zdevito

Differential Revision: D59477339

Pulled By: aaronenyeshi

Pull Request resolved: pytorch#130315
Approved by: https://github.com/zdevito
datagero and others added 16 commits July 9, 2024 22:24
…30271)

Afaict the previous check was too strict. Removing it passes all the
mutation tests (mutation checks happen via the TensorVariable's mutable_local).

Test Plan:
- tests

Pull Request resolved: pytorch#130271
Approved by: https://github.com/Chillee, https://github.com/ydwu4
ghstack dependencies: pytorch#130255, pytorch#130268
…orch#130227)"

This reverts commit 6413998.

Reverted pytorch#130227 on behalf of https://github.com/izaitsevfb due to breaks internal builds, please see D59498662 ([comment](pytorch#130227 (comment)))
…thub.com:datagero/pytorch into fix-dynamo-handler-str-userdefinedobjectvariable
@anijain2305
Copy link
Contributor

@datagero Can you take a look at the failures?

datagero and others added 3 commits July 10, 2024 16:54
…lexAttention numerics to be as accurate as FA2) (pytorch#130250)"

This reverts commit 3e48d92.

Reverted pytorch#130250 on behalf of https://github.com/izaitsevfb due to depends on pytorch#130227 which needs to be reverted ([comment](pytorch#130250 (comment)))
…orch#130227)"

This reverts commit 6413998.

Reverted pytorch#130227 on behalf of https://github.com/izaitsevfb due to breaks internal builds, please see D59498662 ([comment](pytorch#130227 (comment)))
@datagero
Copy link
Contributor Author

Attempting to fix tests, I think #130506 will have a better chance as starting clean.

@datagero datagero closed this Jul 10, 2024
@datagero datagero deleted the fix-dynamo-handler-str-userdefinedobjectvariable branch July 16, 2024 20:11
@datagero datagero restored the fix-dynamo-handler-str-userdefinedobjectvariable branch July 19, 2024 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch._dynamo.exc.Unsupported: builtin: str [<class 'torch._dynamo.variables.user_defined.UserDefinedObjectVariable'>] False