You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a stat library for fbgemm embedding (#4339)
Summary:
Pull Request resolved: #4339
X-link: facebookresearch/FBGEMM#1408
This diff implements a framework to collect statistics within the FBGEMM kernel named `EmbeddingStatsTracker`. We have implemented a class method called `recordPattern` to track embedding access patterns inside `EmbeddingSpMDMAutovec.cc`, which generates a log file that counts the frequency of different access patterns. This feature is controlled by the following environment variables:
- `FBGEMM_STATS_ENABLE` (required) enables or disables the feature. Set to 1 to enable, or leave unset to disable.
- `FBGEMM_STATS_FREQ` (optional) controls how many samples are collected for each log file update and has a default value of `1000000`.
- `FBGEMM_STATS_LOGPATH` (optional) specifies where the log file is written and has a default value of `"/tmp/fbgemm_embedding_stats.txt"`.
We made the following changes:
- Implemented a statistics framework for FBGEMM embedding in `EmbeddingStatsTracker.h` and `EmbeddingStatsTracker.cc`.
- Added the corresponding tracking logic inside `EmbeddingSpMDMAutovec.cc`.
- Added environment variable loading logic in `Util.h` and `Util.cc`.
Reviewed By: excelle08
Differential Revision: D76060846
fbshipit-source-id: ad3445a15b7d0b6f0f8976914ca57def04fc68fd
0 commit comments