Skip to content

Enable MiscTests.test_map_side_effects to work with nn module inlining #126355

@laithsakka

Description

@laithsakka

TORCHDYNAMO_INLINE_INBUILT_NN_MODULES=1 python test/dynamo/test_misc.py -k MiscTests.test_map_side_effects
error:

You can suppress this exception and fall back to eager by setting:
    import torch._dynamo
    torch._dynamo.config.suppress_errors = True


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/users/lsakka/pytorch/pytorch/torch/testing/_internal/common_utils.py", line 2756, in wrapper
    method(*args, **kwargs)
  File "/data/users/lsakka/pytorch/pytorch/test/dynamo/test_misc.py", line 5384, in test_map_side_effects
    with self.assertRaisesRegex(
AssertionError: "Can't inplace modify module params/buffers" does not match "HigherOrderOperator: Mutating a variable not in the current scope (SideEffects)

from user code:
   File "/data/users/lsakka/pytorch/pytorch/test/dynamo/test_misc.py", line 5381, in forward
    return map(body, xs)
  File "/data/users/lsakka/pytorch/pytorch/test/dynamo/test_misc.py", line 5378, in body
    self.w += 1

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information

cc @mruberry @jbschlosser @walterddr @mikaylagawarecki @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng

Metadata

Metadata

Labels

module: dynamomodule: nnRelated to torch.nnoncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions