code stringlengths 3.13k 58.3k | apis sequence | extract_api stringlengths 499 39.4k |
|---|---|---|
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#!/usr/bin/env python3
import abc
import math
from collections import defaultdict, dequ... | [
"torchrec.metrics.metrics_namespace.compose_metric_key"
] | [((943, 965), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (952, 965), False, 'from dataclasses import dataclass\n'), ((1096, 1120), 'typing.TypeVar', 'TypeVar', (['"""DefaultValueT"""'], {}), "('DefaultValueT')\n", (1103, 1120), False, 'from typing import Any, Callable, cast, De... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import copy
import itertools
import logging
from typing import List, Optional, Tuple, It... | [
"torchrec.distributed.utils.append_prefix",
"torchrec.sparse.jagged_tensor.KeyedTensor"
] | [((1068, 1095), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1085, 1095), False, 'import logging\n'), ((3324, 3415), 'torchrec.sparse.jagged_tensor.KeyedTensor', 'KeyedTensor', ([], {'keys': 'self._emb_names', 'values': 'values', 'length_per_key': 'self._lengths_per_emb'}), '(keys=self... |
from typing import (
Iterator,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
)
import io
import torch
import torch.utils.data.datapipes as dp
from torchdata.datapipes.iter import S3FileLister, S3FileLoader
from torchdata.datapipes.utils import StreamWrapper
from torchrec.datasets.utils imp... | [
"torchrec.datasets.utils.ReadLinesFromCSV"
] | [((520, 545), 'torchdata.datapipes.iter.S3FileLister', 'S3FileLister', (['s3_prefixes'], {}), '(s3_prefixes)\n', (532, 545), False, 'from torchdata.datapipes.iter import S3FileLister, S3FileLoader\n'), ((560, 584), 'torchdata.datapipes.iter.S3FileLoader', 'S3FileLoader', (['dp_s3_urls'], {}), '(dp_s3_urls)\n', (572, 58... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import copy
from typing import List, Tuple, Optional, Dict, cast
from torchrec.distribu... | [
"torchrec.distributed.planner.types.PlannerError",
"torchrec.distributed.planner.types.Storage"
] | [((2463, 2484), 'torchrec.distributed.planner.types.Storage', 'Storage', ([], {'hbm': '(0)', 'ddr': '(0)'}), '(hbm=0, ddr=0)\n', (2470, 2484), False, 'from torchrec.distributed.planner.types import Partitioner, Topology, ShardingOption, Storage, PartitionByType, PlannerError, DeviceHardware\n'), ((2964, 3033), 'typing.... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from typing import List, cast
import torch
from torchrec.distributed.em... | [
"torchrec.modules.embedding_configs.EmbeddingBagConfig",
"torchrec.distributed.planner.proposers.GreedyProposer",
"torchrec.distributed.planner.types.Topology",
"torchrec.distributed.planner.proposers.UniformProposer",
"torchrec.distributed.planner.enumerators.EmbeddingEnumerator",
"torchrec.distributed.e... | [((824, 869), 'torchrec.distributed.planner.types.Topology', 'Topology', ([], {'world_size': '(2)', 'compute_device': '"""cuda"""'}), "(world_size=2, compute_device='cuda')\n", (832, 869), False, 'from torchrec.distributed.planner.types import Topology, ShardingOption\n'), ((896, 934), 'torchrec.distributed.planner.enu... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import copy
from functools import reduce
from typing import Tuple, Dict, Optional, List,... | [
"torchrec.distributed.collective_utils.invoke_on_rank_and_broadcast_result",
"torchrec.distributed.planner.storage_reservations.HeuristicalStorageReservation",
"torchrec.distributed.planner.proposers.GreedyProposer",
"torchrec.distributed.planner.stats.EmbeddingStats",
"torchrec.distributed.planner.types.Pl... | [((3958, 3976), 'torchrec.distributed.types.ShardingPlan', 'ShardingPlan', (['plan'], {}), '(plan)\n', (3970, 3976), False, 'from torchrec.distributed.types import ShardingPlan, ShardingPlanner, ModuleSharder, ShardingType, ParameterSharding\n'), ((6132, 6203), 'torchrec.distributed.collective_utils.invoke_on_rank_and_... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import os
import time
from typing import Any, Callable, Dict, Iterable, Iterator, List, ... | [
"torchrec.datasets.utils.LoadFiles",
"torchrec.datasets.utils.safe_cast",
"torchrec.datasets.utils.ReadLinesFromCSV"
] | [((1358, 1380), 'torchrec.datasets.utils.safe_cast', 'safe_cast', (['val', 'int', '(0)'], {}), '(val, int, 0)\n', (1367, 1380), False, 'from torchrec.datasets.utils import Batch, LoadFiles, PATH_MANAGER_KEY, ReadLinesFromCSV, safe_cast\n'), ((3250, 3284), 'torch.utils.data.get_worker_info', 'torch.utils.data.get_worker... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from enum import Enum
from typing import cast, Dict, List, Optional, Tuple, Union
impor... | [
"torchrec.distributed.types.ShardingEnv.from_process_group",
"torchrec.distributed.test_utils.test_model.TestETSharder",
"torchrec.distributed.test_utils.test_model.TestEBCSharder",
"torchrec.distributed.planner.Topology",
"torchrec.distributed.test_utils.test_model.ModelInput.generate",
"torchrec.distrib... | [((2533, 2700), 'torchrec.distributed.test_utils.test_model.ModelInput.generate', 'ModelInput.generate', ([], {'batch_size': 'batch_size', 'world_size': 'world_size', 'num_float_features': 'num_float_features', 'tables': 'tables', 'weighted_tables': '(weighted_tables or [])'}), '(batch_size=batch_size, world_size=world... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from torch.testing import FileCheck # @manual
from torchr... | [
"torchrec.models.dlrm.SparseArch",
"torchrec.modules.embedding_configs.EmbeddingBagConfig",
"torchrec.models.dlrm.DenseArch",
"torchrec.models.dlrm.choose",
"torchrec.models.dlrm.InteractionArch",
"torchrec.models.dlrm.DLRM",
"torchrec.modules.embedding_modules.EmbeddingBagCollection",
"torchrec.fx.sy... | [((715, 735), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (732, 735), False, 'import torch\n'), ((772, 869), 'torchrec.modules.embedding_configs.EmbeddingBagConfig', 'EmbeddingBagConfig', ([], {'name': '"""t1"""', 'embedding_dim': 'D', 'num_embeddings': '(10)', 'feature_names': "['f1', 'f3']"}), "... |
"#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved(...TRUNCATED) | ["torchrec.distributed.types.TensorProperties","torchrec.distributed.types.Shard","torchrec.distribu(...TRUNCATED) | "[((1702, 1729), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\\n', (171(...TRUNCATED) |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3