Skip to content

OSS TorchRec MPZCH Modules #3162

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

Closed
wants to merge 1 commit into from
Closed

Conversation

lizhouyu
Copy link
Contributor

@lizhouyu lizhouyu commented Jul 6, 2025

Summary:

Major changes

  • Copy the following files from fb to corresponding location in the torchrec repository
    • fb/distributed/hash_mc_embedding.py → torchrec/distributed/hash_mc_embedding.py
    • fb/modules/hash_mc_evictions.py → torchrec/modules/hash_mc_evictions.py
    • fb/modules/hash_mc_metrics.py → torchrec/modules/hash_mc_metrics.py
    • fb/modules/hash_mc_modules.py → torchrec/modules/hash_mc_modules.py
    • fb/modules/tests/test_hash_mc_evictions.py → torchrec/modules/tests/test_hash_mc_evictions.py
    • fb/modules/tests/test_hash_mc_modules.py → torchrec/modules/tests/test_hash_mc_modules.py
  • Update /modules/hash_mc_metrics.py
    • Replace the tensorboard module with a local file logger in hash_mc_metrics.py module to avoid OSS CI test failures
    • The original tensorboard version is kept in the torchrec/fb folder.
  • Update the license declaration headers for the OSS files
  • Add unittest.skipif condition to test_dynamically_switch_inference_training_mode and test_output_global_offset_tensor to skip these tests when GPU is not available.
  • Update import packages in torch/modules/tests/test_hash_mc_modules.py and torch/modules/tests/test_hash_mc_evictions.py from torch.fb.modules.hash_mc_* to torch.modules.hash_mc_*. And update the BUCK file correspondingly from /torchrec/fb/modules/hash_mc_* to torchrec/modules/hash_mc_*

Next step

  • Wait for fbpkg to pick up the Diff and update the existing dependencies on MPZCH modules from torchrec/fb/module to torchrec/modules.
  • Wait for all the dependencies being updated, then clean up the files in torchrec/fb/module.

Differential Revision: D77825114

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 6, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D77825114

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D77825114

lizhouyu added a commit to lizhouyu/torchrec that referenced this pull request Jul 6, 2025
Summary:
Pull Request resolved: pytorch#3162

### Major changes
- Copy the following files from `fb` to corresponding location in the `torchrec` repository
  - `fb/distributed/hash_mc_embedding.py → torchrec/distributed/hash_mc_embedding.py`
  - `fb/modules/hash_mc_evictions.py → torchrec/modules/hash_mc_evictions.py`
  - `fb/modules/hash_mc_metrics.py → torchrec/modules/hash_mc_metrics.py`
  - `fb/modules/hash_mc_modules.py → torchrec/modules/hash_mc_modules.py`
  - `fb/modules/tests/test_hash_mc_evictions.py → torchrec/modules/tests/test_hash_mc_evictions.py`
  - `fb/modules/tests/test_hash_mc_modules.py → torchrec/modules/tests/test_hash_mc_modules.py`
- Update `/modules/hash_mc_metrics.py`
  - Replace the tensorboard module with a local file logger in `hash_mc_metrics.py` module to avoid OSS CI test failures
  - The original tensorboard version is kept in the `torchrec/fb` folder.
- Update the license declaration headers for the OSS files
- Add `unittest.skipif` condition to `test_dynamically_switch_inference_training_mode` and `test_output_global_offset_tensor` to skip these tests when GPU is  not available.
- Update import packages in `torch/modules/tests/test_hash_mc_modules.py` and `torch/modules/tests/test_hash_mc_evictions.py` from `torch.fb.modules.hash_mc_*` to `torch.modules.hash_mc_*`. And update the BUCK file correspondingly from `/torchrec/fb/modules/hash_mc_*` to `torchrec/modules/hash_mc_*`

### Next step
- Wait for `fbpkg` to pick up the Diff and update the existing dependencies on MPZCH modules from `torchrec/fb/module` to `torchrec/modules`.
- Wait for all the dependencies being updated, then clean up the files in `torchrec/fb/module`.

Differential Revision: D77825114
@lizhouyu lizhouyu force-pushed the export-D77825114 branch from 7d411d5 to 35958ec Compare July 6, 2025 00:31
Summary:

### Major changes
- Copy the following files from `fb` to corresponding location in the `torchrec` repository
  - `fb/distributed/hash_mc_embedding.py → torchrec/distributed/hash_mc_embedding.py`
  - `fb/modules/hash_mc_evictions.py → torchrec/modules/hash_mc_evictions.py`
  - `fb/modules/hash_mc_metrics.py → torchrec/modules/hash_mc_metrics.py`
  - `fb/modules/hash_mc_modules.py → torchrec/modules/hash_mc_modules.py`
  - `fb/modules/tests/test_hash_mc_evictions.py → torchrec/modules/tests/test_hash_mc_evictions.py`
  - `fb/modules/tests/test_hash_mc_modules.py → torchrec/modules/tests/test_hash_mc_modules.py`
- Update `/modules/hash_mc_metrics.py`
  - Replace the tensorboard module with a local file logger in `hash_mc_metrics.py` module to avoid OSS CI test failures
  - The original tensorboard version is kept in the `torchrec/fb` folder.
- Update the license declaration headers for the OSS files
- Add `unittest.skipif` condition to `test_dynamically_switch_inference_training_mode` and `test_output_global_offset_tensor` to skip these tests when GPU is  not available.
- Update import packages in `torch/modules/tests/test_hash_mc_modules.py` and `torch/modules/tests/test_hash_mc_evictions.py` from `torch.fb.modules.hash_mc_*` to `torch.modules.hash_mc_*`. And update the BUCK file correspondingly from `/torchrec/fb/modules/hash_mc_*` to `torchrec/modules/hash_mc_*`


### Next step
- Wait for `fbpkg` to pick up the Diff and update the existing dependencies on MPZCH modules from `torchrec/fb/module` to `torchrec/modules`.
- Wait for all the dependencies being updated, then clean up the files in `torchrec/fb/module`.

Differential Revision: D77825114
@lizhouyu lizhouyu force-pushed the export-D77825114 branch from 35958ec to 0479d82 Compare July 6, 2025 06:06
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D77825114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants