Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete Operation Support for torchdet Test Tool #61

Open
37 of 54 tasks
sanjif-shanmugavelu opened this issue Sep 25, 2024 · 9 comments
Open
37 of 54 tasks

Incomplete Operation Support for torchdet Test Tool #61

sanjif-shanmugavelu opened this issue Sep 25, 2024 · 9 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@sanjif-shanmugavelu
Copy link
Contributor

sanjif-shanmugavelu commented Sep 25, 2024

List of Non-Deterministic Operations in PyTorch

The following operations in PyTorch exhibit non-deterministic behavior according to the torch.use_deterministic_algorithms documentation. We should ensure the testing tool supports runtime tests on the operations below. Note the list is scraped from the PyTorch 2.4 Stable Release version, and we ideally want to support all ops from 1.6.0 to 2.3, to ensure compatibility with the scanner

TODO: Add Tests for Non-Deterministic Operations

  • torch.nn.Conv1d when called on a CUDA tensor
  • torch.nn.Conv2d when called on a CUDA tensor
  • torch.nn.Conv3d when called on a CUDA tensor
  • torch.nn.ConvTranspose1d when called on a CUDA tensor
  • torch.nn.ConvTranspose2d when called on a CUDA tensor
  • torch.nn.ConvTranspose3d when called on a CUDA tensor
  • torch.nn.ReplicationPad2d when attempting to differentiate a CUDA tensor
  • torch.bmm() when called on sparse-dense CUDA tensors (Mathieu, done)
  • torch.Tensor.__getitem__() when attempting to differentiate a CPU tensor and the index is a list of tensors
  • torch.Tensor.index_put() with accumulate=False
  • torch.Tensor.index_put() with accumulate=True when called on a CPU tensor
  • torch.Tensor.put_() with accumulate=True when called on a CPU tensor
  • torch.Tensor.scatter_add_() when called on a CUDA tensor
  • torch.gather() when called on a CUDA tensor that requires grad
  • torch.index_add() when called on a CUDA tensor
  • torch.index_select() when attempting to differentiate a CUDA tensor
  • torch.repeat_interleave() when attempting to differentiate a CUDA tensor
  • torch.Tensor.index_copy() when called on a CPU or CUDA tensor
  • torch.Tensor.scatter() when src type is Tensor and called on a CUDA tensor
  • torch.Tensor.scatter_reduce() when reduce='sum' or reduce='mean' and called on a CUDA tensor
  • torch.nn.AvgPool3d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.AdaptiveAvgPool2d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.AdaptiveAvgPool3d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.MaxPool3d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.AdaptiveMaxPool2d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.FractionalMaxPool2d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.FractionalMaxPool3d when attempting to differentiate a CUDA tensor @chrisculver
  • torch.nn.MaxUnpool1d @chrisculver
  • torch.nn.MaxUnpool2d @chrisculver
  • torch.nn.MaxUnpool3d @chrisculver
  • torch.nn.functional.interpolate() when attempting to differentiate a CUDA tensor and one of the following modes is used:
    • linear
    • bilinear
    • bicubic
    • trilinear
  • torch.nn.ReflectionPad1d when attempting to differentiate a CUDA tensor
  • torch.nn.ReflectionPad2d when attempting to differentiate a CUDA tensor
  • torch.nn.ReflectionPad3d when attempting to differentiate a CUDA tensor
  • torch.nn.ReplicationPad1d when attempting to differentiate a CUDA tensor
  • torch.nn.ReplicationPad3d when attempting to differentiate a CUDA tensor
  • torch.nn.NLLLoss when called on a CUDA tensor
  • torch.nn.CTCLoss when attempting to differentiate a CUDA tensor
  • torch.nn.EmbeddingBag when attempting to differentiate a CUDA tensor when mode='max' @sanjif-shanmugavelu
  • torch.Tensor.put_() when accumulate=False (@mtaillefumier )
  • torch.Tensor.put_() when accumulate=True and called on a CUDA tensor (@mtaillefumier )
  • torch.histc() when called on a CUDA tensor (@mtaillefumier)
  • torch.bincount() when called on a CUDA tensor and weights tensor is given (@mtaillefumier )
  • torch.kthvalue() when called on a CUDA tensor @sanjif-shanmugavelu
  • torch.median() with indices output when called on a CUDA tensor
  • torch.nn.functional.grid_sample() when attempting to differentiate a CUDA tensor @sanjif-shanmugavelu
  • torch.cumsum() when called on a CUDA tensor when dtype is floating point or complex (@mtaillefumier)
  • torch.Tensor.scatter_reduce() when reduce='prod' and called on a CUDA tensor
  • torch.Tensor.resize_() when called with a quantized tensor @sanjif-shanmugavelu
  • Add latency measurements for torch.nn backwards benchmarks @sanjif-shanmugavelu
@sanjif-shanmugavelu sanjif-shanmugavelu self-assigned this Sep 25, 2024
@sanjif-shanmugavelu sanjif-shanmugavelu changed the title Incomplete Operation Support for torchdet tester Incomplete Operation Support for torchdet Test Tool Sep 25, 2024
@sanjif-shanmugavelu sanjif-shanmugavelu added the help wanted Extra attention is needed label Sep 26, 2024
@markcoletti markcoletti self-assigned this Sep 26, 2024
@markcoletti
Copy link
Contributor

I'm going to add option for specifying output file since I'm pretty confident that @sanjif-shanmugavelu and @chrisculver aren't implementing that. ;)

@markcoletti
Copy link
Contributor

I've added code on the feature branch to suppress the following SciPy warning:

/Users/may/Projects/Ada/minnervva/torchdetscan/venv/lib/python3.11/site-packages/scipy/stats/_axis_nan_policy.py:573: RuntimeWarning: Precision loss occurred in moment calculation due to catastrophic cancellation. This occurs when the data are nearly identical. Results may be unreliable.

@markcoletti
Copy link
Contributor

Added column kernel to output dataframe since there's a chance if the user specifies a filename it's not going to map to a kernel name.

@markcoletti
Copy link
Contributor

Also added a timestamp column to capture when a benchmark was run. I've found that useful for helping me zero in on a specific dataset and to do comparisons between runs.

I've also dropped in tqdm to give some visual feedback on benchmarks since a few could take a while.

@markcoletti
Copy link
Contributor

@sanjif-shanmugavelu , is there a benchmark you could have me work on to add? I'd start on the above list, but there's the risk I'd be duplicating your efforts.

@markcoletti
Copy link
Contributor

Per our conversation on slack, I'll work on implementing benchmark for median.

@markcoletti
Copy link
Contributor

I have pushed a version of support for a median benchmark to the feature branch. However, I recommend that @sanjif-shanmugavelu give it a look as it's very basic and doesn't exercise all possible hyperparameters, such as keepdim.

@mtaillefumier
Copy link

My first contribution to the list: bmm. I keep it separated for now and will open a PR with other kernels as well.

@mtaillefumier
Copy link

Just merged my contributions. git pull -r might be required

@sanjif-shanmugavelu sanjif-shanmugavelu pinned this issue Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants