-
Notifications
You must be signed in to change notification settings - Fork 213
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
Fp8 testing #446
Fp8 testing #446
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/446
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 826bdaf with merge base e5548b7 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both PRs look fine, I'm guessing you only need to merge this one?
I acutallly wasnt necessarily planning on merging this one I just want to see how covering these example float8 workflows I hacking on are |
# Summary # Performance - Need to investigate the Rowwise dynamic case, I would think this should be faster than TensorWise dynamic ```Shell Benchmark Results: +--------------------------+-------------+ | Variant | Time (μs) | +==========================+=============+ | BF16 | 2540.56 | +--------------------------+-------------+ | FP8 Dynamic | 1512.96 | +--------------------------+-------------+ | FP8 Static | 1363.75 | +--------------------------+-------------+ | FP8 Weight Only | 2774.22 | +--------------------------+-------------+ | FP8 Dynamic AxisWise | 1510.82 | +--------------------------+-------------+ | FP8 Static AxisWise | 1438.92 | +--------------------------+-------------+ | FP8 Weight Only AxisWise | 2762.88 | +--------------------------+-------------+ Comparison Results: +--------------------------+-------------+-------------------+---------------+ | Variant | Time (μs) | Speedup vs BF16 | MAE vs BF16 | +==========================+=============+===================+===============+ | BF16 | 2540.56 | 1.00x | 0 | +--------------------------+-------------+-------------------+---------------+ | FP8 Dynamic | 1512.96 | 1.68x | 0.00543213 | +--------------------------+-------------+-------------------+---------------+ | FP8 Static | 1363.75 | 1.86x | 0.00546265 | +--------------------------+-------------+-------------------+---------------+ | FP8 Weight Only | 2774.22 | 0.92x | 0.00379944 | +--------------------------+-------------+-------------------+---------------+ | FP8 Dynamic AxisWise | 1510.82 | 1.68x | 0.00543213 | +--------------------------+-------------+-------------------+---------------+ | FP8 Static AxisWise | 1438.92 | 1.77x | 0.00546265 | +--------------------------+-------------+-------------------+---------------+ | FP8 Weight Only AxisWise | 2762.88 | 0.92x | 0.00379944 | +--------------------------+-------------+-------------------+---------------+ ``` ### Numerics Using this pytorch/ao#446 TensorWise Dynamic scaling: ``` Shell +------------+--------------------------------------------+ | Task | Metrics | +============+============================================+ | winogrande | +-----------------+----------+ | | | | acc,none | 0.735596 | | | | +-----------------+----------+ | | | | acc_stderr,none | 0.012395 | | | | +-----------------+----------+ | +------------+--------------------------------------------+ | wikitext | +-----------------------------+----------+ | | | | bits_per_byte,none | 0.538637 | | | | +-----------------------------+----------+ | | | | bits_per_byte_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | byte_perplexity,none | 1.452600 | | | | +-----------------------------+----------+ | | | | byte_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | word_perplexity,none | 7.363215 | | | | +-----------------------------+----------+ | | | | word_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | +------------+--------------------------------------------+ ``` AxisWise Dynamic Scaling ``` Shell +------------+--------------------------------------------+ | Task | Metrics | +============+============================================+ | winogrande | +-----------------+----------+ | | | | acc,none | 0.735596 | | | | +-----------------+----------+ | | | | acc_stderr,none | 0.012395 | | | | +-----------------+----------+ | +------------+--------------------------------------------+ | wikitext | +-----------------------------+----------+ | | | | bits_per_byte,none | 0.538637 | | | | +-----------------------------+----------+ | | | | bits_per_byte_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | byte_perplexity,none | 1.452600 | | | | +-----------------------------+----------+ | | | | byte_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | word_perplexity,none | 7.363215 | | | | +-----------------------------+----------+ | | | | word_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | +------------+--------------------------------------------+ ``` [ghstack-poisoned]
…ule" # Summary # Performance - Need to investigate the Rowwise dynamic case, I would think this should be faster than TensorWise dynamic ```Shell Benchmark Results: +--------------------------+-------------+ | Variant | Time (μs) | +==========================+=============+ | BF16 | 2540.56 | +--------------------------+-------------+ | FP8 Dynamic | 1512.96 | +--------------------------+-------------+ | FP8 Static | 1363.75 | +--------------------------+-------------+ | FP8 Weight Only | 2774.22 | +--------------------------+-------------+ | FP8 Dynamic AxisWise | 1510.82 | +--------------------------+-------------+ | FP8 Static AxisWise | 1438.92 | +--------------------------+-------------+ | FP8 Weight Only AxisWise | 2762.88 | +--------------------------+-------------+ Comparison Results: +--------------------------+-------------+-------------------+---------------+ | Variant | Time (μs) | Speedup vs BF16 | MAE vs BF16 | +==========================+=============+===================+===============+ | BF16 | 2540.56 | 1.00x | 0 | +--------------------------+-------------+-------------------+---------------+ | FP8 Dynamic | 1512.96 | 1.68x | 0.00543213 | +--------------------------+-------------+-------------------+---------------+ | FP8 Static | 1363.75 | 1.86x | 0.00546265 | +--------------------------+-------------+-------------------+---------------+ | FP8 Weight Only | 2774.22 | 0.92x | 0.00379944 | +--------------------------+-------------+-------------------+---------------+ | FP8 Dynamic AxisWise | 1510.82 | 1.68x | 0.00543213 | +--------------------------+-------------+-------------------+---------------+ | FP8 Static AxisWise | 1438.92 | 1.77x | 0.00546265 | +--------------------------+-------------+-------------------+---------------+ | FP8 Weight Only AxisWise | 2762.88 | 0.92x | 0.00379944 | +--------------------------+-------------+-------------------+---------------+ ``` ### Numerics Using this pytorch/ao#446 TensorWise Dynamic scaling: ``` Shell +------------+--------------------------------------------+ | Task | Metrics | +============+============================================+ | winogrande | +-----------------+----------+ | | | | acc,none | 0.735596 | | | | +-----------------+----------+ | | | | acc_stderr,none | 0.012395 | | | | +-----------------+----------+ | +------------+--------------------------------------------+ | wikitext | +-----------------------------+----------+ | | | | bits_per_byte,none | 0.538637 | | | | +-----------------------------+----------+ | | | | bits_per_byte_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | byte_perplexity,none | 1.452600 | | | | +-----------------------------+----------+ | | | | byte_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | word_perplexity,none | 7.363215 | | | | +-----------------------------+----------+ | | | | word_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | +------------+--------------------------------------------+ ``` AxisWise Dynamic Scaling ``` Shell +------------+--------------------------------------------+ | Task | Metrics | +============+============================================+ | winogrande | +-----------------+----------+ | | | | acc,none | 0.735596 | | | | +-----------------+----------+ | | | | acc_stderr,none | 0.012395 | | | | +-----------------+----------+ | +------------+--------------------------------------------+ | wikitext | +-----------------------------+----------+ | | | | bits_per_byte,none | 0.538637 | | | | +-----------------------------+----------+ | | | | bits_per_byte_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | byte_perplexity,none | 1.452600 | | | | +-----------------------------+----------+ | | | | byte_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | word_perplexity,none | 7.363215 | | | | +-----------------------------+----------+ | | | | word_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | +------------+--------------------------------------------+ ``` [ghstack-poisoned]
# Summary # Performance - Need to investigate the Rowwise dynamic case, I would think this should be faster than TensorWise dynamic ```Shell Benchmark Results: +--------------------------+-------------+ | Variant | Time (μs) | +==========================+=============+ | BF16 | 2540.56 | +--------------------------+-------------+ | FP8 Dynamic | 1512.96 | +--------------------------+-------------+ | FP8 Static | 1363.75 | +--------------------------+-------------+ | FP8 Weight Only | 2774.22 | +--------------------------+-------------+ | FP8 Dynamic AxisWise | 1510.82 | +--------------------------+-------------+ | FP8 Static AxisWise | 1438.92 | +--------------------------+-------------+ | FP8 Weight Only AxisWise | 2762.88 | +--------------------------+-------------+ Comparison Results: +--------------------------+-------------+-------------------+---------------+ | Variant | Time (μs) | Speedup vs BF16 | MAE vs BF16 | +==========================+=============+===================+===============+ | BF16 | 2540.56 | 1.00x | 0 | +--------------------------+-------------+-------------------+---------------+ | FP8 Dynamic | 1512.96 | 1.68x | 0.00543213 | +--------------------------+-------------+-------------------+---------------+ | FP8 Static | 1363.75 | 1.86x | 0.00546265 | +--------------------------+-------------+-------------------+---------------+ | FP8 Weight Only | 2774.22 | 0.92x | 0.00379944 | +--------------------------+-------------+-------------------+---------------+ | FP8 Dynamic AxisWise | 1510.82 | 1.68x | 0.00543213 | +--------------------------+-------------+-------------------+---------------+ | FP8 Static AxisWise | 1438.92 | 1.77x | 0.00546265 | +--------------------------+-------------+-------------------+---------------+ | FP8 Weight Only AxisWise | 2762.88 | 0.92x | 0.00379944 | +--------------------------+-------------+-------------------+---------------+ ``` ### Numerics Using this pytorch/ao#446 TensorWise Dynamic scaling: ``` Shell +------------+--------------------------------------------+ | Task | Metrics | +============+============================================+ | winogrande | +-----------------+----------+ | | | | acc,none | 0.735596 | | | | +-----------------+----------+ | | | | acc_stderr,none | 0.012395 | | | | +-----------------+----------+ | +------------+--------------------------------------------+ | wikitext | +-----------------------------+----------+ | | | | bits_per_byte,none | 0.538637 | | | | +-----------------------------+----------+ | | | | bits_per_byte_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | byte_perplexity,none | 1.452600 | | | | +-----------------------------+----------+ | | | | byte_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | word_perplexity,none | 7.363215 | | | | +-----------------------------+----------+ | | | | word_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | +------------+--------------------------------------------+ ``` AxisWise Dynamic Scaling ``` Shell +------------+--------------------------------------------+ | Task | Metrics | +============+============================================+ | winogrande | +-----------------+----------+ | | | | acc,none | 0.735596 | | | | +-----------------+----------+ | | | | acc_stderr,none | 0.012395 | | | | +-----------------+----------+ | +------------+--------------------------------------------+ | wikitext | +-----------------------------+----------+ | | | | bits_per_byte,none | 0.538637 | | | | +-----------------------------+----------+ | | | | bits_per_byte_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | byte_perplexity,none | 1.452600 | | | | +-----------------------------+----------+ | | | | byte_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | | | | word_perplexity,none | 7.363215 | | | | +-----------------------------+----------+ | | | | word_perplexity_stderr,none | N/A | | | | +-----------------------------+----------+ | +------------+--------------------------------------------+ ``` [ghstack-poisoned]
Summary: Download android ndk r26c Use that to run build_android.sh Test Plan: CI Reviewers: Subscribers: Tasks: Tags:
Summary
python scripts/hf_eval.py -q fp8
Took 5 mins... but
python scripts/hf_eval.py -q fp8 --compile