Skip to content

Commit

Permalink
Merge branch 'dmlc:master' into add-igb-to-sage
Browse files Browse the repository at this point in the history
  • Loading branch information
BowenYao18 committed Aug 25, 2024
2 parents e6ec96f + ea940f7 commit 81ba919
Show file tree
Hide file tree
Showing 33 changed files with 1,269 additions and 342 deletions.
2 changes: 2 additions & 0 deletions docs/source/api/python/dgl.graphbolt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ collection of features.
TorchBasedFeature
TorchBasedFeatureStore
DiskBasedFeature
cpu_cached_feature
CPUCachedFeature
gpu_cached_feature
GPUCachedFeature


Expand Down
12 changes: 6 additions & 6 deletions examples/graphbolt/disk_based_feature/node_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ def parse_args():
"--cpu-cache-size-in-gigabytes",
type=float,
default=0,
help="The capacity of the CPU cache, the number of features to store.",
help="The capacity of the CPU cache in GiB.",
)
parser.add_argument(
"--gpu-cache-size-in-gigabytes",
type=float,
default=0,
help="The capacity of the GPU cache, the number of features to store.",
help="The capacity of the GPU cache in GiB.",
)
parser.add_argument("--early-stopping-patience", type=int, default=25)
parser.add_argument(
Expand Down Expand Up @@ -457,14 +457,14 @@ def main():
if args.cpu_cache_size_in_gigabytes > 0 and isinstance(
features[("node", None, "feat")], gb.DiskBasedFeature
):
features[("node", None, "feat")] = gb.CPUCachedFeature(
features[("node", None, "feat")] = gb.cpu_cached_feature(
features[("node", None, "feat")],
int(args.cpu_cache_size_in_gigabytes * 1024 * 1024 * 1024),
args.cpu_feature_cache_policy,
args.feature_device == "pinned",
)
cpu_cached_feature = features[("node", None, "feat")]
cpu_cache_miss_rate_fn = lambda: cpu_cached_feature._feature.miss_rate
cpu_cache_miss_rate_fn = lambda: cpu_cached_feature.miss_rate
else:
cpu_cache_miss_rate_fn = lambda: 1

Expand All @@ -474,12 +474,12 @@ def main():
host-to-device copy operations for this feature.
"""
if args.gpu_cache_size_in_gigabytes > 0 and args.feature_device != "cuda":
features[("node", None, "feat")] = gb.GPUCachedFeature(
features[("node", None, "feat")] = gb.gpu_cached_feature(
features[("node", None, "feat")],
int(args.gpu_cache_size_in_gigabytes * 1024 * 1024 * 1024),
)
gpu_cached_feature = features[("node", None, "feat")]
gpu_cache_miss_rate_fn = lambda: gpu_cached_feature._feature.miss_rate
gpu_cache_miss_rate_fn = lambda: gpu_cached_feature.miss_rate
else:
gpu_cache_miss_rate_fn = lambda: 1

Expand Down
Loading

0 comments on commit 81ba919

Please sign in to comment.