Skip to content

Add benchmark for measuring create_block_mask creation time #137

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

Merged
merged 3 commits into from
May 5, 2025

Conversation

drisspg
Copy link
Contributor

@drisspg drisspg commented May 5, 2025

Stack from ghstack (oldest at bottom):

Pull-Request-resolved: #136

Need to figure out why memory allocated is not behaving correctly

❯ python benchmarks/bench_block_mask.py
Running 15 benchmark configurations...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [00:14<00:00,  1.03it/s]
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   B |   H |     M |     N | Mask Mod               |   Creation Time (ms) |   Memory (GiB) |
+=====+=====+=======+=======+========================+======================+================+
|   1 |   8 |  8192 |  8192 | causal                 |               0.1657 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 |  8192 |  8192 | sliding_window         |               0.226  |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 |  8192 |  8192 | prefix_lm              |               0.1693 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 |  8192 |  8192 | doc_mask_mod           |               1.0622 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 |  8192 |  8192 | dilated_sliding_window |               0.4233 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 16384 | 16384 | causal                 |               1.5539 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 16384 | 16384 | sliding_window         |               2.8478 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 16384 | 16384 | prefix_lm              |               1.598  |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 16384 | 16384 | doc_mask_mod           |               7.6279 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 16384 | 16384 | dilated_sliding_window |               4.9444 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 32768 | 32768 | causal                 |               6.0614 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 32768 | 32768 | sliding_window         |              11.2369 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 32768 | 32768 | prefix_lm              |               6.2164 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 32768 | 32768 | doc_mask_mod           |              30.3449 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+
|   1 |   8 | 32768 | 32768 | dilated_sliding_window |              19.6154 |              0 |
+-----+-----+-------+-------+------------------------+----------------------+----------------+

[ghstack-poisoned]
drisspg added a commit that referenced this pull request May 5, 2025
ghstack-source-id: 3165f82
Pull-Request-resolved: #136

ghstack-source-id: 08fd434
Pull Request resolved: #137
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 5, 2025
[ghstack-poisoned]
drisspg added a commit that referenced this pull request May 5, 2025
ghstack-source-id: ac76af6
Pull-Request-resolved: #136

ghstack-source-id: ac76af6
Pull Request resolved: #137
[ghstack-poisoned]
drisspg added a commit that referenced this pull request May 5, 2025
ghstack-source-id: e8fdd99
Pull-Request-resolved: #136

ghstack-source-id: e8fdd99
Pull Request resolved: #137
@drisspg drisspg merged commit 9cb3301 into gh/drisspg/2/base May 5, 2025
4 checks passed
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 Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants