Skip to content
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

[GraphBolt] Enable CPUCachedFeature for r-gcn mag240M example. #7611

Open
mfbalin opened this issue Jul 29, 2024 · 1 comment
Open

[GraphBolt] Enable CPUCachedFeature for r-gcn mag240M example. #7611

mfbalin opened this issue Jul 29, 2024 · 1 comment
Labels
Work Item Work items tracked in project tracker

Comments

@mfbalin
Copy link
Collaborator

mfbalin commented Jul 29, 2024

🔨Work Item

IMPORTANT:

  • This template is only for dev team to track project progress. For feature request or bug report, please use the corresponding issue templates.
  • DO NOT create a new work item if the purpose is to fix an existing issue or feature request. We will directly use the issue in the project tracker.

Project tracker: https://github.com/orgs/dmlc/projects/2

Description

Following:

if args.num_cpu_cached_features > 0 and isinstance(
features[("node", None, "feat")], gb.DiskBasedFeature
):
features[("node", None, "feat")] = gb.CPUCachedFeature(
features[("node", None, "feat")],
args.num_cpu_cached_features * feature_num_bytes,
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
else:
cpu_cache_miss_rate_fn = lambda: 1

we can update rgcn example to use new DiskBasedFeature and CPUCachedFeature.

dataset = gb.BuiltinDataset(dataset_name)
if disk_based_feature_keys is None:
disk_based_feature_keys = set()
for feature in dataset.yaml_data["feature_data"]:
feature_key = (feature["domain"], feature["type"], feature["name"])
# Set the in_memory setting to False without modifying YAML file.
if feature_key in disk_based_feature_keys:
feature["in_memory"] = False
dataset = dataset.load()

@Rhett-Ying

@mfbalin mfbalin added the Work Item Work items tracked in project tracker label Jul 29, 2024
@mfbalin mfbalin added this to the 2024 Graphbolt Misc milestone Jul 29, 2024
@mfbalin
Copy link
Collaborator Author

mfbalin commented Aug 22, 2024

#7722 has an example on how to do it for hetero datasets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Work Item Work items tracked in project tracker
Projects
None yet
Development

No branches or pull requests

1 participant