-
Notifications
You must be signed in to change notification settings - Fork 90
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
Improve parallelisation strategy for conv2d #15171
Comments
# Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Tue Nov 5 10:20:56 2024 +0000 # # On branch pjosipovic/conv2d_better_parallelization # Your branch is up to date with 'origin/pjosipovic/conv2d_better_parallelization'. # # Changes to be committed: # modified: models/demos/ttnn_resnet/tt/ttnn_functional_resnet50_new_conv_api.py # modified: models/demos/wormhole/stable_diffusion/tt/ttnn_functional_downsample_2d_new_conv.py # modified: models/demos/wormhole/stable_diffusion/tt/ttnn_functional_resnetblock2d_new_conv.py # modified: models/demos/yolov4/ttnn/downsample1.py # modified: models/experimental/functional_unet/tt/unet_shallow_ttnn.py # modified: tests/sweep_framework/sweeps/conv2d/short/conv2d_short_sweep.py # modified: tests/ttnn/unit_tests/operations/test_maxpool2d.py # modified: tests/ttnn/unit_tests/operations/test_new_conv2d.py # modified: ttnn/cpp/ttnn/operations/conv/conv2d/conv2d.cpp # modified: ttnn/cpp/ttnn/operations/conv/conv2d/conv2d.hpp # modified: ttnn/cpp/ttnn/operations/conv/conv2d/conv2d_pybind.cpp # modified: ttnn/cpp/ttnn/operations/conv/conv2d/device/conv2d_op.cpp # modified: ttnn/cpp/ttnn/operations/conv/conv2d/device/conv2d_op.hpp # modified: ttnn/cpp/ttnn/operations/conv/conv2d/device/conv2d_op_sharded_program_factory.cpp # modified: ttnn/cpp/ttnn/operations/conv/conv2d/device/conv2d_op_width_sharded_program_factory.cpp # modified: ttnn/cpp/ttnn/operations/conv/conv_transpose2d/conv_transpose2d.cpp # modified: ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp # modified: ttnn/cpp/ttnn/operations/pool/maxpool/max_pool2d.cpp # modified: ttnn/ttnn/__init__.py # modified: ttnn/ttnn/operations/conv2d.py #
Hi @pavlejosipovic - We hit compile error in tt-mlir after uplifting to latest tt-metal that includes this change because new field |
- due to tt-metal changes from tenstorrent/tt-metal#15171
For conv ops it should be set to true, and for max_pool it should be set to false. |
- due to tt-metal changes from tenstorrent/tt-metal#15171 (cherry picked from commit 14cbe04)
Conv2d determines number of work items along height and width dim and than tries to map to an array of tensix cores in 1d or 2d depending on the sharding strategy selected. In case this number of work items is a primer number or close to the prime number, conv2d will map one core or a handful of cores.
In addition to poor performance in these cases, this leads to out-of-memory issues since conv2d can use small number of cores to store the sharded tensors, and single core gets to process large chunk of work.
To improve on this we need to pad number of work items so that we can distribute the the workload in an effective way over the grid of tensix cores.
The text was updated successfully, but these errors were encountered: