Skip to content

Conversation

pearu
Copy link
Collaborator

@pearu pearu commented Sep 1, 2025

As in the title.

This PR is marked as Draft as it requires the torch PR stack starting at pytorch/pytorch#161891 (read: CI failures are expected).

Same as #4022 but using C++ torch::stable::Tensor API instead of C shim Tensor API and this PR includes also the GPU port.

PLEASE NOTE THAT THE TORCHAUDIO REPOSITORY IS NO LONGER ACTIVELY MONITORED. You may not get a response. For open discussions, visit https://discuss.pytorch.org/.

Copy link

pytorch-bot bot commented Sep 1, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 007452e with merge base 87ff22e (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla meta-cla bot added the CLA Signed label Sep 1, 2025
@pearu pearu linked an issue Sep 2, 2025 that may be closed by this pull request
5 tasks
@pearu pearu added this to the 2.10 milestone Sep 2, 2025
@pearu pearu force-pushed the pearu/stable-abi-forced_align branch from b3a5a0e to 282bd7f Compare September 18, 2025 16:46
@pearu pearu marked this pull request as ready for review September 18, 2025 18:28
@pearu pearu requested a review from a team as a code owner September 18, 2025 18:28
@pearu pearu requested a review from samanklesaria September 18, 2025 18:50
Copy link
Collaborator

@samanklesaria samanklesaria 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 to me!

TORCH_CHECK(
logProbs.size(1) == at::max(inputLengths).item().toInt(),
STD_TORCH_CHECK(
logProbs.size(1) == torchaudio::util::max<int>(inputLengths),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is likely a bug: when inputLenghts is a int64 tensor, int32-casting may produce incorrect result.

C10_CUDA_KERNEL_LAUNCH_CHECK();
++backPtrBufferLen;
if (backPtrBufferLen == kBackPtrBufferSize || t == T - 1) {
cpuDataTranferStream.synchronize();
// GPU -> GPU copy
bufferCopy = backPtrBuffer.clone().contiguous();
bufferCopy = torchaudio::stable::clone(backPtrBuffer);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nit: use clone(memory_format=contiguous_format) to ensure contiguous bufferCopy.

// template<typename T, size_t N, template <typename U> class PtrTraits =
// torchaudio::stable::DefaultPtrTraits, typename index_t = int64_t>
// GenericPackedTensorAccessor<T,N> generic_packed_accessor(const Tensor& t) &&
// = delete;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove.

Comment on lines +137 to +139
// template<typename T, size_t N, template <typename U> class PtrTraits =
// torchaudio::stable::DefaultPtrTraits> PackedTensorAccessor32<T,N,PtrTraits>
// packed_accessor32(const Tensor& t) && = delete;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove.

Comment on lines +150 to +152
// template<typename T, size_t N, template <typename U> class PtrTraits =
// DefaultPtrTraits> PackedTensorAccessor64<T,N,PtrTraits>
// packed_accessor64(const Tensor& t) && = delete;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove.

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.

[STABLE ABI] Porting forced_align
2 participants