Skip to content

Commit

Permalink
Bump up CUDA version used for tests
Browse files Browse the repository at this point in the history
- disable MXNet tests are MXNet is no longer
  actively developed
- extend support for DLPack capsules that provide
  strides collapsing dimensions
- updates TSM PaddlePaddle example to the latest API
- removes SSD PaddlePaddle example as it uses many no longer
  supported functions (SSD specific)

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
  • Loading branch information
JanuszL committed Oct 26, 2023
1 parent 15a4956 commit 88a3c65
Show file tree
Hide file tree
Showing 27 changed files with 95 additions and 736 deletions.
9 changes: 8 additions & 1 deletion dali/python/backend_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,18 @@ void CheckContiguousTensor(const TStrides &strides, int num_strides,
DALI_ENFORCE(num_strides == num_extents,
"There should be exactly as many strides as there are extents in array shape.");
int64_t stride_from_shape = element_size;
int64_t stride_from_shape_collapsed = 1;
int64_t last_non_one_dim = 1;
for (int i = num_strides - 1; i >= 0; i--) {
DALI_ENFORCE(strides[i] == stride_from_shape,
DALI_ENFORCE(strides[i] == stride_from_shape || strides[i] == stride_from_shape_collapsed,
make_string("Strided data not supported. Dimension ", i, " has stride ", strides[i],
" whereas densely packed data of this shape would have a stride ", stride_from_shape));
stride_from_shape *= shape[i];
// for shapes [1, 1, 5] leading dimensions may not contribute to
if (shape[i] != 1) {
stride_from_shape_collapsed *= last_non_one_dim;
last_non_one_dim = shape[i];
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions dali/test/python/test_torch_pipeline_rnnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def forward(self, inp, seq_len):
# do stft
x = torch.stft(x, n_fft=self.n_fft, hop_length=self.hop_length,
win_length=self.win_length, pad_mode='reflect',
center=True, window=self.window.to(dtype=torch.float).to(x.device))
center=True, window=self.window.to(dtype=torch.float).to(x.device),
return_complex=True)
x = torch.view_as_real(x)

# get power spectrum
x = x.pow(2).sum(-1)
Expand Down Expand Up @@ -214,7 +216,9 @@ def torch_spectrogram(audio, sample_rate, device='cpu',
window_tensor = window_fn(win_length, periodic=False) if window_fn else None
stft_out = torch.stft(audio, n_fft=n_fft, hop_length=hop_length,
win_length=win_length, pad_mode=pad_mode,
center=center, window=window_tensor.to(dtype=torch.float))
center=center, window=window_tensor.to(dtype=torch.float),
return_complex=True)
stft_out = torch.view_as_real(stft_out)
# get power spectrum
spectrogram = stft_out.pow(2).sum(-1)
spectrogram = spectrogram.cpu().numpy()
Expand Down
1 change: 0 additions & 1 deletion docs/examples/use_cases/paddle/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
underline_char="=",
entries=[
"resnet50/paddle-resnet50.rst",
"ssd/paddle-ssd.rst",
"tsm/paddle-tsm.rst",
])
58 changes: 0 additions & 58 deletions docs/examples/use_cases/paddle/ssd/paddle-ssd.rst

This file was deleted.

202 changes: 0 additions & 202 deletions docs/examples/use_cases/paddle/ssd/ssd.py

This file was deleted.

Loading

0 comments on commit 88a3c65

Please sign in to comment.