Skip to content
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

#1683: Updated memory collection and report of dram and l1 using new metal APIs #1726

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

tapspatel
Copy link
Contributor

@tapspatel tapspatel commented Jan 7, 2025

This will dump a memory json report after every op execution with the following structure for every device in meshDevice

"0": {
        "loc": "loc(\"/code/tt-mlir/build/test/ttmlir/Silicon/TTNN/perf_unit/Output/test_perf_and.mlir.tmp.mlir\":9:10)",
        "debug_str": "%0 = \"ttnn.get_device\"() <{mesh_shape = #ttnn<mesh_shape 1x1>}> : () -> !tt.device<<workerGrid = #tt.grid<8x8, (d0, d1) -> (0, d0, d1)>, l1Map = (d0, d1)[s0, s1] -> (0, d0 floordiv s0, d1 floordiv s1, (d0 mod s0) * s1 + d1 mod s1), dramMap = (d0, d1)[s0, s1] -> (0, 0, ((((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 8192) mod 12, (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 98304 + (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) mod 8192), meshShape = , chipIds = [0]>> loc(\"/code/tt-mlir/build/test/ttmlir/Silicon/TTNN/perf_unit/Output/test_perf_and.mlir.tmp.mlir\":9:10)",
        "dram": {
            "device_0": {
                "num_banks": 12,
                "bytes_allocatable_per_bank": 1073741792,
                "bytes_allocated_per_bank": 0,
                "bytes_free_per_bank": 1073741792,
                "total_bytes_allocatable": 12884901504,
                "total_bytes_allocated": 0,
                "total_bytes_free": 12884901504,
                "largest_contiguous_bytes_free_per_bank": 1073741792,
                "block_table": [
                    {
                        "allocated": "no",
                        "nextID": "-1",
                        "prevID": "-1",
                        "size": "1073741792",
                        "address": "0",
                        "blockID": "0"
                    }
                ]
            }
        },
        "l1": {
            "device_0": {
                "num_banks": 64,
                "bytes_allocatable_per_bank": 1367264,
                "bytes_allocated_per_bank": 0,
                "bytes_free_per_bank": 1367264,
                "total_bytes_allocatable": 87504896,
                "total_bytes_allocated": 0,
                "total_bytes_free": 87504896,
                "largest_contiguous_bytes_free_per_bank": 1367264,
                "block_table": [
                    {
                        "allocated": "no",
                        "nextID": "-1",
                        "prevID": "-1",
                        "size": "1367264",
                        "address": "0",
                        "blockID": "0"
                    }
                ]
            }
        }
    },

@tapspatel
Copy link
Contributor Author

Dependent on: tenstorrent/tt-metal#16368

@tapspatel tapspatel linked an issue Jan 7, 2025 that may be closed by this pull request
@tapspatel tapspatel force-pushed the tpatel/issue-1683 branch 2 times, most recently from 7757540 to b72971d Compare January 8, 2025 00:47
@tapspatel
Copy link
Contributor Author

updated APIs to print dram, l1, l1_small and trace memory dumps

Copy link
Contributor

@kmabeeTT kmabeeTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Taps!

@tapspatel tapspatel merged commit a485cf4 into main Jan 16, 2025
20 checks passed
@tapspatel tapspatel deleted the tpatel/issue-1683 branch January 16, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update memory report in ttrt with new memory allocator
4 participants