Replace looks up a key with Read. Read marks the key as in use after lookup if it exists. Insert didn't mark the keys in use.
Until after the keys have actually been inserted into the feature cache (not policy), we actually need to mark them in use. Thus, changing the default value of the reference count to 1 fixes Insert not marking the keys as in use. After that, we need to unmark them as not in use after the embeddings are inserted into the inmemory feature embedding cache.
Checklist
Please feel free to remove inapplicable items for your PR.
[ ] The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
[ ] I've leverage the tools to beautify the python and c++ code.
[ ] The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
[ ] All changes have test coverage
[ ] Code is well-documented
[ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
[ ] Related issue is referred in this PR
[ ] If the PR is for a new model/paper, I've updated the example index here.
@dgl-bot run [instance-type] [which tests] [compare-with-branch];
For example: @dgl-bot run g4dn.4xlarge all dmlc/master or @dgl-bot run c5.9xlarge kernel,api dmlc/master
Description
Replace looks up a key with Read. Read marks the key as in use after lookup if it exists. Insert didn't mark the keys in use.
Until after the keys have actually been inserted into the feature cache (not policy), we actually need to mark them in use. Thus, changing the default value of the reference count to 1 fixes Insert not marking the keys as in use. After that, we need to unmark them as not in use after the embeddings are inserted into the inmemory feature embedding cache.
Checklist
Please feel free to remove inapplicable items for your PR.
Changes