Skip to content

Add space complexity metrics#38

Merged
frneer merged 8 commits intomainfrom
frn/add_metrics
May 30, 2025
Merged

Add space complexity metrics#38
frneer merged 8 commits intomainfrom
frn/add_metrics

Conversation

@frneer
Copy link
Owner

@frneer frneer commented May 24, 2025

This patch adds the code to compute space complexity metrics. Supporting both UniformQuantizer and FlexQuantizer.

For the FlexQuantizer, we introduce the nominal huffman complexity computation, to get a relative value of the expected size when implementing that in hardware.

@frneer frneer changed the title Add space computation metrics Add space complexity metrics May 24, 2025
@frneer
Copy link
Owner Author

frneer commented May 24, 2025

@colorete87 PTAL, see the tests. I also tested with some examples locally and it seems to be working. We still need to add tests for huffman computation, but that will require manually computing the results and creating the tests accordingly.

@frneer frneer force-pushed the frn/add_metrics branch from 8ecc8bd to 57f33f5 Compare May 24, 2025 17:13
@colorete87
Copy link
Collaborator

When running the test with $ ./metrics_test.py -k test_flex_quantizer_space_complexity a strange behaiour is observed: the computed complexity (computed_bits) sometimes is zero and sometimes don't:

  • Example with non-zero result:
    image
  • Example with complexity equal to zero:
    image

@frneer frneer force-pushed the frn/add_metrics branch from 5eab6df to ca372c8 Compare May 29, 2025 12:17
@frneer frneer force-pushed the frn/add_metrics branch from 6d72e73 to ded44d5 Compare May 30, 2025 15:48
@frneer frneer merged commit 4b5fe2f into main May 30, 2025
2 checks passed
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.

2 participants