From 3375de19ec6acc8d041ec3ade0c71aff99fe4b0c Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Wed, 23 Oct 2024 13:27:31 -0700 Subject: [PATCH] c10::nullopt -> std::nullopt Summary: X-link: https://github.com/pytorch/torchrec/pull/2515 X-link: https://github.com/pytorch/executorch/pull/6461 X-link: https://github.com/pytorch/audio/pull/3848 X-link: https://github.com/pytorch/ao/pull/1151 X-link: https://github.com/facebookincubator/AITemplate/pull/1032 Reviewed By: houseroad Differential Revision: D64835967 fbshipit-source-id: 9f9f65335aaf5497680561027ef9314e4b36f8d9 --- .../backward/embedding_backward_dense_host_cpu.cpp | 6 +++--- .../embedding_backward_split_host_template.cpp | 12 ++++++------ .../embedding_split_host_pt2_autograd_template.cpp | 12 ++++++------ .../experimental/gen_ai/src/gemm/ck_extensions.hip | 2 +- fbgemm_gpu/experimental/gen_ai/src/gemm/gemm.cpp | 4 ++-- .../quantize/ck_extensions/fp8_rowwise_gemm.hip | 2 +- .../quantize/cutlass_extensions/f8f8bf16_cublas.cu | 12 ++++++------ .../cutlass_extensions/f8f8bf16_rowwise.cu | 8 ++++---- .../cutlass_extensions/f8f8bf16_rowwise_batched.cu | 8 ++++---- .../experimental/gen_ai/src/quantize/quantize.cpp | 14 +++++++------- .../include/fbgemm_gpu/embedding_inplace_update.h | 12 ++++++------ fbgemm_gpu/include/fbgemm_gpu/sparse_ops.h | 2 +- fbgemm_gpu/src/quantize_ops/quantize_ops_cpu.cpp | 4 ++-- fbgemm_gpu/src/sparse_ops/common.h | 2 +- fbgemm_gpu/src/sparse_ops/sparse_async_cumsum.cpp | 2 +- fbgemm_gpu/src/sparse_ops/sparse_ops_cpu.cpp | 2 +- fbgemm_gpu/src/sparse_ops/sparse_permute_1d.cu | 4 ++-- fbgemm_gpu/src/sparse_ops/sparse_permute_2d.cu | 4 ++-- .../linearize_cache_indices.cu | 4 ++-- .../src/split_embeddings_cache/lru_cache_find.cu | 2 +- 20 files changed, 59 insertions(+), 59 deletions(-) diff --git a/fbgemm_gpu/codegen/training/backward/embedding_backward_dense_host_cpu.cpp b/fbgemm_gpu/codegen/training/backward/embedding_backward_dense_host_cpu.cpp index 89bc580c7a..ee608e83e0 100644 --- a/fbgemm_gpu/codegen/training/backward/embedding_backward_dense_host_cpu.cpp +++ b/fbgemm_gpu/codegen/training/backward/embedding_backward_dense_host_cpu.cpp @@ -164,11 +164,11 @@ Tensor split_embedding_codegen_lookup_dense_function( const std::optional& indice_weights, const std::optional& feature_requires_grad, int64_t /* output_dtype = static_cast(SparseType::FP32) */, - const std::optional& /* B_offsets = c10::nullopt */, + const std::optional& /* B_offsets = std::nullopt */, const std::optional< - Tensor>& /* vbe_output_offsets_feature_rank = c10::nullopt */, + Tensor>& /* vbe_output_offsets_feature_rank = std::nullopt */, const std::optional< - Tensor>& /* vbe_B_offsets_rank_per_feature = c10::nullopt */, + Tensor>& /* vbe_B_offsets_rank_per_feature = std::nullopt */, c10::SymInt /* max_B = -1 */, c10::SymInt /* max_B_feature_rank = -1 */, c10::SymInt /* vbe_output_size = -1 */) { diff --git a/fbgemm_gpu/codegen/training/backward/embedding_backward_split_host_template.cpp b/fbgemm_gpu/codegen/training/backward/embedding_backward_split_host_template.cpp index 9628abb88c..d705afa080 100644 --- a/fbgemm_gpu/codegen/training/backward/embedding_backward_split_host_template.cpp +++ b/fbgemm_gpu/codegen/training/backward/embedding_backward_split_host_template.cpp @@ -1006,9 +1006,9 @@ Tensor {{ bwd_mdesc }}_embedding_codegen_lookup_{{ optimizer }}_function( {{ args.split_function_args | join(", ") }}, {%- endif %} const int64_t output_dtype = static_cast(SparseType::FP32), - const std::optional& B_offsets = c10::nullopt, - const std::optional& vbe_output_offsets_feature_rank = c10::nullopt, - const std::optional& vbe_B_offsets_rank_per_feature = c10::nullopt, + const std::optional& B_offsets = std::nullopt, + const std::optional& vbe_output_offsets_feature_rank = std::nullopt, + const std::optional& vbe_B_offsets_rank_per_feature = std::nullopt, const c10::SymInt max_B = -1, const c10::SymInt max_B_feature_rank = -1, {%- if not dense %} @@ -1016,16 +1016,16 @@ Tensor {{ bwd_mdesc }}_embedding_codegen_lookup_{{ optimizer }}_function( const bool is_experimental_tbe = false, // formerly named is_experimental const bool use_uniq_cache_locations_bwd = false, const bool use_homogeneous_placements = false, - const std::optional& uvm_cache_stats = c10::nullopt, + const std::optional& uvm_cache_stats = std::nullopt, {%- if "prev_iter_dev" not in args.split_function_arg_names %} - const std::optional& prev_iter_dev = c10::nullopt, + const std::optional& prev_iter_dev = std::nullopt, {%- endif %} {%- if "iter" not in args.split_function_arg_names %} const int64_t iter = 0, {%- endif %} const bool apply_global_weight_decay = false, {%- if ssd %} - const std::optional& ssd_tensors = c10::nullopt, + const std::optional& ssd_tensors = std::nullopt, {%- endif %} const double gwd_lower_bound = 0 {%- else %} diff --git a/fbgemm_gpu/codegen/training/pt2/embedding_split_host_pt2_autograd_template.cpp b/fbgemm_gpu/codegen/training/pt2/embedding_split_host_pt2_autograd_template.cpp index 9c0eb320bc..e831b96b8f 100644 --- a/fbgemm_gpu/codegen/training/pt2/embedding_split_host_pt2_autograd_template.cpp +++ b/fbgemm_gpu/codegen/training/pt2/embedding_split_host_pt2_autograd_template.cpp @@ -987,25 +987,25 @@ Tensor {{ bwd_mdesc }}_embedding_codegen_lookup_{{ optimizer }}_function_pt2( {%- endif %} {{ args_pt2.unified_pt2.split_function_args | join(", ") }}, const int64_t output_dtype = static_cast(SparseType::FP32), - const std::optional& B_offsets = c10::nullopt, - const std::optional& vbe_output_offsets_feature_rank = c10::nullopt, - const std::optional& vbe_B_offsets_rank_per_feature = c10::nullopt, + const std::optional& B_offsets = std::nullopt, + const std::optional& vbe_output_offsets_feature_rank = std::nullopt, + const std::optional& vbe_B_offsets_rank_per_feature = std::nullopt, const c10::SymInt max_B = -1, const c10::SymInt max_B_feature_rank = -1, const c10::SymInt vbe_output_size = -1, const bool is_experimental_tbe = false, // formerly named is_experimental const bool use_uniq_cache_locations_bwd = false, const bool use_homogeneous_placements = false, - const std::optional& uvm_cache_stats = c10::nullopt, + const std::optional& uvm_cache_stats = std::nullopt, {%- if "prev_iter_dev" not in args_pt2.split_function_arg_names %} - const std::optional& prev_iter_dev = c10::nullopt, + const std::optional& prev_iter_dev = std::nullopt, {%- endif %} {%- if "iter" not in args_pt2.split_function_arg_names %} const int64_t iter = 0, {%- endif %} const bool apply_global_weight_decay = false, {%- if ssd %} - const std::optional& ssd_tensors = c10::nullopt, + const std::optional& ssd_tensors = std::nullopt, {%- endif %} const double gwd_lower_bound = 0 ) { diff --git a/fbgemm_gpu/experimental/gen_ai/src/gemm/ck_extensions.hip b/fbgemm_gpu/experimental/gen_ai/src/gemm/ck_extensions.hip index 40908837cd..8688c1df5e 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/gemm/ck_extensions.hip +++ b/fbgemm_gpu/experimental/gen_ai/src/gemm/ck_extensions.hip @@ -211,7 +211,7 @@ at::Tensor dispatch_bf16_gemm(at::Tensor A, at::Tensor B, std::optional bias = c10::nullopt) { +at::Tensor bf16_gemm(at::Tensor A, at::Tensor B, std::optional bias = std::nullopt) { TORCH_CHECK( A.dtype() == at::kBFloat16 && B.dtype() == at::kBFloat16, "Inputs must be bfloat16."); diff --git a/fbgemm_gpu/experimental/gen_ai/src/gemm/gemm.cpp b/fbgemm_gpu/experimental/gen_ai/src/gemm/gemm.cpp index 97def9ea9b..d45ef64f64 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/gemm/gemm.cpp +++ b/fbgemm_gpu/experimental/gen_ai/src/gemm/gemm.cpp @@ -14,7 +14,7 @@ namespace fbgemm_gpu { at::Tensor bf16_gemm( at::Tensor A, at::Tensor B, - std::optional bias = c10::nullopt); + std::optional bias = std::nullopt); TORCH_LIBRARY_FRAGMENT(fbgemm, m) { #ifdef USE_ROCM @@ -31,7 +31,7 @@ TORCH_LIBRARY_IMPL(fbgemm, CUDA, m) { at::Tensor bf16_gemm_meta( at::Tensor A, at::Tensor B, - std::optional /* bias */ = c10::nullopt) { + std::optional /* bias */ = std::nullopt) { const at::SymInt M = A.sym_size(0); const at::SymInt N = B.sym_size(0); auto C = at::empty_symint({M, N}, A.options().dtype(at::kBFloat16)); diff --git a/fbgemm_gpu/experimental/gen_ai/src/quantize/ck_extensions/fp8_rowwise_gemm.hip b/fbgemm_gpu/experimental/gen_ai/src/quantize/ck_extensions/fp8_rowwise_gemm.hip index ca3eba949b..365a1bc08a 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/quantize/ck_extensions/fp8_rowwise_gemm.hip +++ b/fbgemm_gpu/experimental/gen_ai/src/quantize/ck_extensions/fp8_rowwise_gemm.hip @@ -257,7 +257,7 @@ at::Tensor f8f8bf16_rowwise( at::Tensor w_scale, std::optional bias, bool use_fast_accum, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { // Check that input datatypes are valid. TORCH_CHECK( (XQ.dtype() == at::kFloat8_e4m3fnuz) && diff --git a/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_cublas.cu b/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_cublas.cu index 04979323e9..ec7453969b 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_cublas.cu +++ b/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_cublas.cu @@ -20,10 +20,10 @@ namespace fbgemm_gpu { at::Tensor f8f8bf16_cublas( at::Tensor A, // FP8 at::Tensor B, // FP8 - std::optional Ainvs = c10::nullopt, - std::optional Binvs = c10::nullopt, + std::optional Ainvs = std::nullopt, + std::optional Binvs = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { auto m = A.size(0); auto n = B.size(0); auto k = A.size(1); @@ -167,10 +167,10 @@ at::Tensor f8f8bf16_cublas( at::Tensor f8f8bf16_cublas( at::Tensor A, // FP8 at::Tensor B, // FP8 - std::optional Ainvs = c10::nullopt, - std::optional Binvs = c10::nullopt, + std::optional Ainvs = std::nullopt, + std::optional Binvs = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { throw std::runtime_error( "CUDA version is older than 12.0"); // requires CUDA>=12 } diff --git a/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise.cu b/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise.cu index 1e27eef6e7..6b82f7eff3 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise.cu +++ b/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise.cu @@ -361,9 +361,9 @@ at::Tensor f8f8bf16_rowwise( at::Tensor WQ, // FP8 at::Tensor x_scale, // FP32 at::Tensor w_scale, // FP32 - std::optional bias = c10::nullopt, + std::optional bias = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { // Check datatypes. TORCH_CHECK( x_scale.dtype() == at::kFloat && w_scale.dtype() == at::kFloat, @@ -482,9 +482,9 @@ at::Tensor f8f8bf16_rowwise( at::Tensor WQ, // FP8 at::Tensor x_scale, at::Tensor w_scale, - std::optional bias = c10::nullopt, + std::optional bias = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { throw std::runtime_error( "CUDA version is older than 12.0"); // requires CUDA>=12 } diff --git a/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise_batched.cu b/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise_batched.cu index 344bfe0544..ead6787ef6 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise_batched.cu +++ b/fbgemm_gpu/experimental/gen_ai/src/quantize/cutlass_extensions/f8f8bf16_rowwise_batched.cu @@ -599,9 +599,9 @@ at::Tensor f8f8bf16_rowwise_batched( at::Tensor WQ, // FP8 at::Tensor x_scale, // FP32 at::Tensor w_scale, // FP32 - std::optional bias = c10::nullopt, + std::optional bias = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { // Check datatypes. TORCH_CHECK( x_scale.dtype() == at::kFloat && w_scale.dtype() == at::kFloat, @@ -720,9 +720,9 @@ at::Tensor f8f8bf16_rowwise_batched( at::Tensor WQ, // FP8 at::Tensor x_scale, at::Tensor w_scale, - std::optional bias = c10::nullopt, + std::optional bias = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt) { + std::optional output = std::nullopt) { throw std::runtime_error( "CUDA version is older than 12.0"); // requires CUDA>=12 } diff --git a/fbgemm_gpu/experimental/gen_ai/src/quantize/quantize.cpp b/fbgemm_gpu/experimental/gen_ai/src/quantize/quantize.cpp index c20f3449d1..f6d6cc5b58 100644 --- a/fbgemm_gpu/experimental/gen_ai/src/quantize/quantize.cpp +++ b/fbgemm_gpu/experimental/gen_ai/src/quantize/quantize.cpp @@ -59,17 +59,17 @@ at::Tensor f8f8bf16_rowwise( at::Tensor WQ, at::Tensor x_scale, at::Tensor w_scale, - std::optional bias = c10::nullopt, + std::optional bias = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt); + std::optional output = std::nullopt); at::Tensor f8f8bf16_rowwise_batched( at::Tensor XQ, at::Tensor WQ, at::Tensor x_scale, at::Tensor w_scale, - std::optional bias = c10::nullopt, + std::optional bias = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt); + std::optional output = std::nullopt); at::Tensor f8f8bf16_blockwise( at::Tensor XQ, at::Tensor WQ, @@ -81,10 +81,10 @@ at::Tensor f8f8bf16_blockwise( at::Tensor f8f8bf16_cublas( at::Tensor A, at::Tensor B, - std::optional Ainvs = c10::nullopt, - std::optional Binvs = c10::nullopt, + std::optional Ainvs = std::nullopt, + std::optional Binvs = std::nullopt, bool use_fast_accum = true, - std::optional output = c10::nullopt); + std::optional output = std::nullopt); at::Tensor f8i4bf16_rowwise( at::Tensor XQ, at::Tensor WQ, diff --git a/fbgemm_gpu/include/fbgemm_gpu/embedding_inplace_update.h b/fbgemm_gpu/include/fbgemm_gpu/embedding_inplace_update.h index 55870d378d..bbfaff10a2 100644 --- a/fbgemm_gpu/include/fbgemm_gpu/embedding_inplace_update.h +++ b/fbgemm_gpu/include/fbgemm_gpu/embedding_inplace_update.h @@ -54,8 +54,8 @@ void embedding_inplace_update_cuda( Tensor update_row_idx, Tensor update_offsets, const int64_t row_alignment, - std::optional lxu_cache_weights = c10::nullopt, - std::optional lxu_cache_locations = c10::nullopt); + std::optional lxu_cache_weights = std::nullopt, + std::optional lxu_cache_locations = std::nullopt); void embedding_inplace_update_single_placement_cuda( Tensor& dev_weights, @@ -69,8 +69,8 @@ void embedding_inplace_update_single_placement_cuda( const Tensor& update_row_idx, const Tensor& update_offsets, const int64_t row_alignment, - std::optional lxu_cache_weights = c10::nullopt, - std::optional lxu_cache_locations = c10::nullopt); + std::optional lxu_cache_weights = std::nullopt, + std::optional lxu_cache_locations = std::nullopt); void embedding_inplace_update_cpu( Tensor dev_weights, @@ -85,9 +85,9 @@ void embedding_inplace_update_cpu( Tensor update_offsets, const int64_t row_alignment, std::optional lxu_cache_weights = - c10::nullopt, // Not used, to match cache interface for CUDA op + std::nullopt, // Not used, to match cache interface for CUDA op std::optional lxu_cache_locations = - c10::nullopt // Not used, to match cache interface for CUDA op + std::nullopt // Not used, to match cache interface for CUDA op ); /** diff --git a/fbgemm_gpu/include/fbgemm_gpu/sparse_ops.h b/fbgemm_gpu/include/fbgemm_gpu/sparse_ops.h index 41ba190fc8..7fbf475a8f 100644 --- a/fbgemm_gpu/include/fbgemm_gpu/sparse_ops.h +++ b/fbgemm_gpu/include/fbgemm_gpu/sparse_ops.h @@ -987,7 +987,7 @@ std::vector jagged_index_select_2d( const at::Tensor& values, const at::Tensor& lengths, const at::Tensor& indices, - const std::optional num_dense_output_rows = c10::nullopt); + const std::optional num_dense_output_rows = std::nullopt); at::Tensor jagged_index_select_2d_forward_cpu( const at::Tensor& values, diff --git a/fbgemm_gpu/src/quantize_ops/quantize_ops_cpu.cpp b/fbgemm_gpu/src/quantize_ops/quantize_ops_cpu.cpp index 3512132448..f10fd25d6a 100644 --- a/fbgemm_gpu/src/quantize_ops/quantize_ops_cpu.cpp +++ b/fbgemm_gpu/src/quantize_ops/quantize_ops_cpu.cpp @@ -44,7 +44,7 @@ Tensor& _float_to_fused8bitrowwise_cpu_out_t( auto output_dims = input_sizes.vec(); output_dims[last_dim] = output_columns; - at::native::resize_(output, output_dims, c10::nullopt); + at::native::resize_(output, output_dims, std::nullopt); const auto input_data = static_cast( input.data_ptr()); // input.data_ptr(); -> Yields @@ -73,7 +73,7 @@ Tensor& _fused8bitrowwise_to_float_cpu_out_t( auto output_dims = input_sizes.vec(); output_dims[last_dim] = output_columns; - at::native::resize_(output, output_dims, c10::nullopt); + at::native::resize_(output, output_dims, std::nullopt); auto output_data = static_cast( output.data_ptr()); // output.data_ptr(); -> Yields diff --git a/fbgemm_gpu/src/sparse_ops/common.h b/fbgemm_gpu/src/sparse_ops/common.h index 1cdd8ce9ef..9ebdbf44e5 100644 --- a/fbgemm_gpu/src/sparse_ops/common.h +++ b/fbgemm_gpu/src/sparse_ops/common.h @@ -20,7 +20,7 @@ inline Tensor native_empty_like(const Tensor& self) { self.options().layout_opt(), self.options().device_opt(), self.options().pinned_memory_opt(), - c10::nullopt); + std::nullopt); } } // namespace diff --git a/fbgemm_gpu/src/sparse_ops/sparse_async_cumsum.cpp b/fbgemm_gpu/src/sparse_ops/sparse_async_cumsum.cpp index e3f04b58e8..3cf7fd96ca 100644 --- a/fbgemm_gpu/src/sparse_ops/sparse_async_cumsum.cpp +++ b/fbgemm_gpu/src/sparse_ops/sparse_async_cumsum.cpp @@ -39,7 +39,7 @@ void asynchronous_exclusive_cumsum_cpu_out(Tensor& t_out, const Tensor& t_in) { TENSOR_ON_CPU(t_out); const auto t_in_contig = t_in.expect_contiguous(); - at::native::resize_(t_out, t_in_contig->sizes(), c10::nullopt); + at::native::resize_(t_out, t_in_contig->sizes(), std::nullopt); FBGEMM_DISPATCH_ALL_TYPES( t_in_contig->scalar_type(), diff --git a/fbgemm_gpu/src/sparse_ops/sparse_ops_cpu.cpp b/fbgemm_gpu/src/sparse_ops/sparse_ops_cpu.cpp index 88d9ef2e6a..e15878619c 100644 --- a/fbgemm_gpu/src/sparse_ops/sparse_ops_cpu.cpp +++ b/fbgemm_gpu/src/sparse_ops/sparse_ops_cpu.cpp @@ -2354,7 +2354,7 @@ Tensor& lengths_range_out( }); } - at::native::resize_(output, {output_size}, c10::nullopt); + at::native::resize_(output, {output_size}, std::nullopt); AT_DISPATCH_INDEX_TYPES( t_in_contig->scalar_type(), "lengths_range_compute", [&]() { diff --git a/fbgemm_gpu/src/sparse_ops/sparse_permute_1d.cu b/fbgemm_gpu/src/sparse_ops/sparse_permute_1d.cu index fbd54fd3ac..78332bc0d6 100644 --- a/fbgemm_gpu/src/sparse_ops/sparse_permute_1d.cu +++ b/fbgemm_gpu/src/sparse_ops/sparse_permute_1d.cu @@ -87,8 +87,8 @@ permute_1D_sparse_data_cuda( return { lengths.view({-1}).clone(), indices.clone(), - weights.has_value() ? c10::make_optional(weights->clone()) - : c10::nullopt}; + weights.has_value() ? std::make_optional(weights->clone()) + : std::nullopt}; } Tensor permuted_lengths; diff --git a/fbgemm_gpu/src/sparse_ops/sparse_permute_2d.cu b/fbgemm_gpu/src/sparse_ops/sparse_permute_2d.cu index 62fa0fd882..18262adcfd 100644 --- a/fbgemm_gpu/src/sparse_ops/sparse_permute_2d.cu +++ b/fbgemm_gpu/src/sparse_ops/sparse_permute_2d.cu @@ -93,8 +93,8 @@ permute_2D_sparse_data_cuda( return { lengths.clone(), indices.clone(), - weights.has_value() ? c10::make_optional(weights->clone()) - : c10::nullopt, + weights.has_value() ? std::make_optional(weights->clone()) + : std::nullopt, }; } diff --git a/fbgemm_gpu/src/split_embeddings_cache/linearize_cache_indices.cu b/fbgemm_gpu/src/split_embeddings_cache/linearize_cache_indices.cu index e2911f127a..a96b254bfd 100644 --- a/fbgemm_gpu/src/split_embeddings_cache/linearize_cache_indices.cu +++ b/fbgemm_gpu/src/split_embeddings_cache/linearize_cache_indices.cu @@ -217,8 +217,8 @@ get_unique_indices_cuda_impl( auto unique_indices = at::empty_like(linear_indices); auto unique_indices_length = at::empty({1}, linear_indices.options().dtype(at::kInt)); - std::optional unique_indices_count = c10::nullopt; - std::optional linear_index_positions_sorted = c10::nullopt; + std::optional unique_indices_count = std::nullopt; + std::optional linear_index_positions_sorted = std::nullopt; Tensor linear_index_positions; if (compute_inverse_indices) { diff --git a/fbgemm_gpu/src/split_embeddings_cache/lru_cache_find.cu b/fbgemm_gpu/src/split_embeddings_cache/lru_cache_find.cu index aed852e66a..517d1b373b 100644 --- a/fbgemm_gpu/src/split_embeddings_cache/lru_cache_find.cu +++ b/fbgemm_gpu/src/split_embeddings_cache/lru_cache_find.cu @@ -186,7 +186,7 @@ lru_cache_find_uncached_cuda( auto cache_set_sorted_unique_indices = empty_like(unique_indices); Tensor cache_sets_positions; - std::optional cache_set_inverse_indices = c10::nullopt; + std::optional cache_set_inverse_indices = std::nullopt; if (compute_inverse_indices) { TORCH_CHECK( cache_sets.numel() <=