10000 force computation in opmath_t for CUDA fused optimizers by MeetThePatel · Pull Request #154069 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

force computation in opmath_t for CUDA fused optimizers #154069

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lints.
  • Loading branch information
MeetThePatel committed May 23, 2025
commit 2f5411f71edba1e1aa65f230cdbaed032a5551e3
10 changes: 4 additions & 6 deletions aten/src/ATen/native/cuda/FusedSgdKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ void _fused_sgd_with_momentum_kernel_cuda_(
const std::optional<at::Tensor>& grad_scale,
const std::optional<at::Tensor>& found_inf) {
TORCH_CHECK_GT(momentum, 0);
TORCH_CHECK(
at::native::check_fast_path_restrictions(
{params, grads, momentum_buffer_list}));
TORCH_CHECK(at::native::check_fast_path_restrictions(
{params, grads, momentum_buffer_list}));
float* grad_scale_ptr =
grad_scale.has_value() ? grad_scale->data_ptr<float>() : nullptr;
float* found_inf_ptr =
Expand Down Expand Up @@ -228,9 +227,8 @@ void _fused_sgd_with_momentum_kernel_cuda_(
return;
}
TORCH_CHECK_GT(momentum, 0);
TORCH_CHECK(
at::native::check_fast_path_restrictions(
{params, grads, momentum_buffer_list}));
TORCH_CHECK(at::native::check_fast_path_restrictions(
{params, grads, momentum_buffer_list}));
if (grad_scale.has_value()) {
TORCH_CHECK(
grad_scale->device() == params[0].device(),
Expand Down
Loading
0