Skip to content

Commit

Permalink
[fbgemm_gpu] Small docs fixes
Browse files Browse the repository at this point in the history
- Small docs fixes
  • Loading branch information
q10 committed Feb 22, 2024
1 parent 45353ed commit 7d976be
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
20 changes: 11 additions & 9 deletions .github/scripts/fbgemm_gpu_test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,16 @@ run_fbgemm_gpu_tests () {

test_setup_conda_environment () {
local env_name="$1"
local python_version="$2"
local pytorch_installer="$3"
local pytorch_version="$4"
local pytorch_variant_type="$5"
local pytorch_variant_version="$6"
local compiler="$2"
local python_version="$3"
local pytorch_installer="$4"
local pytorch_version="$5"
local pytorch_variant_type="$6"
local pytorch_variant_version="$7"
if [ "$pytorch_variant_type" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME PYTHON_VERSION PYTORCH_INSTALLER PYTORCH_VERSION PYTORCH_VARIANT_TYPE [PYTORCH_VARIANT_VERSION]"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env 3.12 pip test cuda 12.1.0 # Setup environment with pytorch-test for Python 3.12 + CUDA 12.1.0"
echo " ${FUNCNAME[0]} build_env clang 3.12 pip test cuda 12.1.0 # Setup environment with pytorch-test for Clang + Python 3.12 + CUDA 12.1.0"
return 1
else
echo "################################################################################"
Expand All @@ -243,19 +244,20 @@ test_setup_conda_environment () {

# Set up the build tools and/or GPU runtimes
if [ "$pytorch_variant_type" == "cuda" ]; then
install_cxx_compiler "${env_name}" || return 1
install_cxx_compiler "${env_name}" "${compiler}" || return 1
install_build_tools "${env_name}" || return 1
install_cuda "${env_name}" "${pytorch_variant_version}" || return 1
install_cudnn "${env_name}" "${HOME}/cudnn-${pytorch_variant_version}" "${pytorch_variant_version}" || return 1

elif [ "$pytorch_variant_type" == "rocm" ]; then
install_rocm_ubuntu "${env_name}" "${pytorch_variant_version}" || return 1
install_cxx_compiler "${env_name}" "${compiler}" || return 1
install_build_tools "${env_name}" || return 1
return 1

else
install_cxx_compiler "${env_name}" || return 1
install_build_tools "${env_name}" || return 1
install_cxx_compiler "${env_name}" "${compiler}" || return 1
install_build_tools "${env_name}" || return 1
fi

# Install PyTorch
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/test_torchrec.bash
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else
fi

# shellcheck disable=SC2086
test_setup_conda_environment "$env_name" "$python_version" pip "$pytorch_channel_name" $pytorch_variant
test_setup_conda_environment "$env_name" gcc "$python_version" pip "$pytorch_channel_name" $pytorch_variant

# Comment out FBGEMM_GPU since we will install it from "$fbgemm_wheel_path"
sed -i 's/fbgemm-gpu/#fbgemm-gpu/g' requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion fbgemm_gpu/fbgemm_gpu/docs/table_batched_embedding_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""
SplitTableBatchedEmbeddingBagsCodegen(embedding_specs, feature_table_map=None, cache_algorithm=CacheAlgorithm.LRU, cache_load_factor=0.2, cache_sets=0, cache_reserved_memory=0.0, cache_precision=SparseType.FP32, weights_precision=SparseType.FP32, output_dtype=SparseType.FP32, enforce_hbm=False, optimizer=OptimType.EXACT_SGD, record_cache_metrics=None, stochastic_rounding=True, gradient_clipping=False, max_gradient=1.0, learning_rate=0.01, eps=1.0e-8, momentum=0.9, weight_decay=0.0, weight_decay_mode=WeightDecayMode.NONE, eta=0.001, beta1=0.9, beta2=0.999, pooling_mode=PoolingMode.SUM, device=None, bounds_check_mode=BoundsCheckMode.WARNING) -> None
Table batched Embedding operator. Looks up one or more embedding tables. The module is application for training. The backward operator is fused with optimizer. Thus, the embedding tables are updated during backward.
Table Batched Embedding (TBE) operator. Looks up one or more embedding tables. The module is application for training. The backward operator is fused with optimizer. Thus, the embedding tables are updated during backward.
Args:
embedding_specs (List[Tuple[int, int, EmbeddingLocation, ComputeDevice]]): A list of embedding specifications. Each spec is a tuple of (number of embedding rows, embedding dimension; must be a multiple of 4, table placement, compute device).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ def apply_split_helper(
# pyre-fixme[13]: Attribute `local_uvm_cache_stats` is never initialized.
class SplitTableBatchedEmbeddingBagsCodegen(nn.Module):
"""
Table Batched Embedding (TBE) operator. Please see
docs/table_batched_embedding_ops.py for the extended documentation.
Multiple sparse features can share one embedding table.
'feature_table_map' specifies the feature-table mapping.
T: number of logical tables
Expand Down
6 changes: 3 additions & 3 deletions fbgemm_gpu/include/fbgemm_gpu/cumem_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Tensor uvm_to_device(const Tensor& self, const Tensor& prototype);
///
/// @see See <a
/// href="https://nvidia.github.io/cuda-python/module/cudart.html#cuda.cudart.cudaMemAdvise">here</a>
/// For more information on the `cudaMemoryAdvise` enum.
/// for more information on the `cudaMemoryAdvise` enum.
void uvm_cuda_mem_advise(const Tensor& self, int64_t cuda_memory_advise);

/// @ingroup cumem-utils
Expand All @@ -150,7 +150,7 @@ void uvm_cuda_mem_advise(const Tensor& self, int64_t cuda_memory_advise);
///
/// @see See <a
/// href="https://nvidia.github.io/cuda-python/module/cudart.html#cuda.cudart.cudaMemPrefetchAsync">here</a>
/// For more information on `cudaMemPrefetchAsync()`.
/// for more information on `cudaMemPrefetchAsync()`.
void uvm_cuda_mem_prefetch_async(
const Tensor& self,
c10::optional<Tensor> device_t);
Expand All @@ -165,7 +165,7 @@ void uvm_cuda_mem_prefetch_async(
/// @param self The input tensor
///
/// @see See <a
/// href="https://man7.org/linux/man-pages/man2/madvise.2.html">here</a> For
/// href="https://man7.org/linux/man-pages/man2/madvise.2.html">here</a> for
/// more information on `madvise()`.
void uvm_mem_advice_dont_fork(const Tensor& self);

Expand Down

0 comments on commit 7d976be

Please sign in to comment.