Repository: pytorch
Issue: 31 Dynamo test are failing with "'NoneType' object has no attribute 'profiler'".
Labels: triaged,oncall: pt2,module: dynamo,dynamo-must-fix,dynamo-triage-june2024

31 Dynamo test are failing with "'NoneType' object has no attribute 'profiler'".

## Repro

`PYTORCH_TEST_WITH_DYNAMO=1 pytest profiler/test_profiler.py -v -k test_profiler_correlation_id`

You will need to remove the skip or expectedFailure before running the repro command.
This may be just removing a line in
[dynamo_test_failures.py](https://github.com/pytorch/pytorch/blob/main/torch/testing/_internal/dynamo_test_failures.py)

## Failing tests

Here's a comprehensive list of tests that fail (as of this issue) with the above message:
<details>
<summary>Click me</summary>
```
profiler/test_profiler.py::TestProfiler.test_profiler_correlation_id
profiler/test_profiler.py::TestTorchTidyProfiler.test_allocation_id_uniqueness
profiler/test_profiler.py::TestTorchTidyProfiler.test_allocation_ids
profiler/test_profiler.py::TestTorchTidyProfiler.test_allocation_ids_with_other_ops
profiler/test_profiler.py::TestTorchTidyProfiler.test_allocations
profiler/test_profiler.py::TestTorchTidyProfiler.test_extra_fields
profiler/test_profiler.py::TestTorchTidyProfiler.test_impl_reuse
profiler/test_profiler.py::TestTorchTidyProfiler.test_mkldnn_tensors
profiler/test_profiler.py::TestTorchTidyProfiler.test_module_and_optimizer_ids
profiler/test_profiler.py::TestTorchTidyProfiler.test_nnmodule_params
profiler/test_profiler.py::TestTorchTidyProfiler.test_optimizer
profiler/test_profiler.py::TestTorchTidyProfiler.test_optimizer_parameters_adam
profiler/test_profiler.py::TestTorchTidyProfiler.test_optimizer_parameters_sgd
profiler/test_profiler.py::TestTorchTidyProfiler.test_pointers_and_ids
profiler/test_profiler.py::TestTorchTidyProfiler.test_scalar_ins
profiler/test_profiler.py::TestTorchTidyProfiler.test_tensor_lists
profiler/test_profiler.py::TestTorchTidyProfiler.test_tensor_properties
profiler/test_profiler.py::TestTorchTidyProfiler.test_tensorimpl_invalidation_full
profiler/test_profiler.py::TestTorchTidyProfiler.test_tensorimpl_invalidation_keep_alive
profiler/test_profiler.py::TestTorchTidyProfiler.test_tensorimpl_invalidation_scalar_args
profiler/test_profiler.py::TestTorchTidyProfiler.test_tensorimpl_invalidation_set
profiler/test_profiler.py::TestExperimentalUtils.test_profiler_name_pattern
profiler/test_profiler.py::TestExperimentalUtils.test_profiler_pattern_match_helper
profiler/test_profiler.py::TestExperimentalUtils.test_profiler_pattern_matcher_json_report
profiler/test_profiler.py::TestExperimentalUtils.test_profiler_synchronized_dataloader_pattern
profiler/test_profiler.py::TestExperimentalUtils.test_utils_compute_queue_depth_when_no_cuda_events
profiler/test_profiler.py::TestExperimentalUtils.test_utils_compute_self_time
profiler/test_profiler_tree.py::TestProfilerTree.test_profiler_experimental_tree
profiler/test_profiler_tree.py::TestProfilerTree.test_profiler_experimental_tree_with_memory
profiler/test_profiler_tree.py::TestProfilerTree.test_profiler_experimental_tree_with_memory_and_stack
profiler/test_profiler_tree.py::TestProfilerTree.test_profiler_experimental_tree_with_stack_and_torch_function
```
</details>

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