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

[Autotuner] Plotting utility + test #2394

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

luarss
Copy link
Contributor

@luarss luarss commented Sep 29, 2024

  • Plotting utility
  • README

@luarss luarss requested a review from vvbandeira September 29, 2024 05:16
@luarss luarss self-assigned this Oct 8, 2024
@luarss luarss added the autotuner Flow autotuner label Oct 8, 2024
docs/user/InstructionsForAutoTuner.md Outdated Show resolved Hide resolved
tools/AutoTuner/src/autotuner/utils/plot.py Outdated Show resolved Hide resolved
Copy link
Member

@vvbandeira vvbandeira left a comment

Choose a reason for hiding this comment

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

Please add a call to this script in the test_helper.py so we test this script.

@luarss luarss changed the title [Autotuner] Plotting utility [Autotuner] Plotting utility + test Oct 11, 2024
@luarss luarss requested a review from vvbandeira October 11, 2024 14:58
@luarss luarss marked this pull request as draft October 16, 2024 09:30
@luarss luarss marked this pull request as ready for review October 17, 2024 00:35
@luarss luarss marked this pull request as draft January 10, 2025 17:36
luarss and others added 5 commits January 11, 2025 06:38
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Signed-off-by: luarss <jluar@precisioninno.com>
Signed-off-by: Vitor Bandeira <vvbandeira@users.noreply.github.com>
Signed-off-by: luarss <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
@luarss luarss marked this pull request as ready for review January 11, 2025 12:55
flow/test/test_autotuner.sh Outdated Show resolved Hide resolved
Comment on lines 31 to 33
except Exception as e:
print(f"Error in {fname}: {e}")
continue
Copy link
Member

Choose a reason for hiding this comment

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

Should we keep a list of the files that were not processed so we can print them at the very end in order for the error not to be buried in the logs? And should the script fail silently in this case?

Copy link
Contributor Author

@luarss luarss Jan 11, 2025

Choose a reason for hiding this comment

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

And should the script fail silently in this case?

Just to clarify, this exception happens when any Autotuner run does not proceed to the "finish" stage, it does not fail silently

Should we keep a list of the files that were not processed so we can print them at the very end in order for the error not to be buried in the logs?

Sure I can add that.

Comment on lines 72 to 73
z = np.polyfit(df["timestamp"], df[key], 1)
p = np.poly1d(z)
Copy link
Member

Choose a reason for hiding this comment

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

z I assume is the z-axis; what is p?

Copy link
Contributor Author

@luarss luarss Jan 11, 2025

Choose a reason for hiding this comment

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

z is the np array of polynomial (ax+b) coefficients, and p is the actual polynomial function.

Copy link
Member

Choose a reason for hiding this comment

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

Then let's use more descriptive names, maybe:
z --> coeff
p --> poly_func

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
plt.boxplot(df[key])
plt.ylabel(key)
plt.title(f"{key} Boxplot")
plt.savefig(f"images/{key}-boxplot.png")
Copy link
Member

Choose a reason for hiding this comment

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

Let's also parametrize the output folder to save images from CI into the reports folder for the design. This way it will be automatically saved to the build artifacts.

- run plot.py for all log files in the autotuner supported design/platforms
- parameterised img_dir, so we can store all AT image runs in build artifacts
- argparse interface now takes in platform, design, experiment for easier usage
- chdir before running plot.py
- add docstrings
- more error handling

Signed-off-by: Jack Luar <jluar@precisioninno.com>
@luarss luarss requested a review from vvbandeira January 12, 2025 14:19
Comment on lines 39 to 40
--platform ${PLATFORM} \
--design ${DESIGN_NAME} \
Copy link
Member

Choose a reason for hiding this comment

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

At the beginning of this script, you are casting these values to be uppercase, which does not match the path since Linux is case-sensitive. From the CI:

02:32:36  Running Autotuner plotting smoke test
02:32:36  ls: cannot access './flow/logs/SKY130HD/gcd/*/': No such file or directory
02:32:36  No experiments found for plotting
02:32:36  + exit 0

Copy link
Member

Choose a reason for hiding this comment

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

If we call the plot script and do not find data to plot, this should be an error, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, these are 2 separate errors, will fix them.

Signed-off-by: luarss <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
@luarss luarss requested a review from vvbandeira January 14, 2025 02:44
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autotuner Flow autotuner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants