-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d04824
commit 7679cf7
Showing
14 changed files
with
71 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
""" | ||
Command line interface for out Python application. | ||
You can call commands from the command line. | ||
Example | ||
>>> $ itwinai --help | ||
""" | ||
|
||
# NOTE: import libs in the command"s function, not here. | ||
# Otherwise this will slow the whole CLI. | ||
# -------------------------------------------------------------------------------------- | ||
# Part of the interTwin Project: https://www.intertwin.eu/ | ||
# | ||
# Created by: Matteo Bunino | ||
# | ||
# Credits: | ||
# - Matteo Bunino <[email protected]> - CERN | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# | ||
# -------------------------------------------------------------------------------------- | ||
# Command-line interface for the itwinai Python library. | ||
# Example: | ||
# | ||
# >>> itwinai --help | ||
# | ||
# -------------------------------------------------------------------------------------- | ||
# | ||
# NOTE: import libraries in the command's function, not here, as having them here will | ||
# slow down the CLI commands significantly. | ||
|
||
from pathlib import Path | ||
from typing import List, Optional | ||
|
@@ -80,7 +88,6 @@ def generate_gpu_data_plots( | |
energy_plot_path = plot_dir_path / "gpu_energy_plot.png" | ||
utilization_plot_path = plot_dir_path / "utilization_plot.png" | ||
|
||
# Plotting and saving figures to file | ||
energy_fig, _ = gpu_bar_plot( | ||
data_df=energy_df, | ||
plot_title="Energy Consumption by Strategy and Number of GPUs", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# -------------------------------------------------------------------------------------- | ||
# Part of the interTwin Project: https://www.intertwin.eu/ | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN Openlab | ||
# - Matteo Bunino <[email protected]> - CERN Openlab | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# - Matteo Bunino <[email protected]> - CERN | ||
# -------------------------------------------------------------------------------------- | ||
|
||
import glob | ||
|
@@ -118,6 +118,7 @@ def create_absolute_plot(avg_epoch_time_df: pd.DataFrame) -> None: | |
|
||
marker_cycle = cycle("ov^s*dXpD.+12348") | ||
|
||
unique_nodes = list(avg_epoch_time_df["nodes"].unique()) | ||
unique_names = avg_epoch_time_df["name"].unique() | ||
for name in unique_names: | ||
# color, marker = next(color_marker_combinations) | ||
|
@@ -133,16 +134,18 @@ def create_absolute_plot(avg_epoch_time_df: pd.DataFrame) -> None: | |
markersize=6, | ||
) | ||
|
||
# Labeling the axes and setting the title | ||
ax.set_yscale("log") | ||
ax.set_xscale("log") | ||
|
||
ax.set_xticks(unique_nodes) | ||
|
||
ax.set_xlabel("Number of Nodes") | ||
ax.set_ylabel("Average Time") | ||
ax.set_ylabel("Average Time (s)") | ||
ax.set_title("Average Time vs Number of Nodes") | ||
|
||
# Show legend and grid | ||
ax.legend(title="Method") | ||
ax.grid(True) | ||
|
||
# Save the plot as an image | ||
output_path = Path("plots/absolute_scalability_plot.png") | ||
plt.savefig(output_path) | ||
print(f"Saving absolute plot to '{output_path.resolve()}'.") | ||
|
@@ -181,7 +184,9 @@ def create_relative_plot(avg_epoch_time_df: pd.DataFrame, gpus_per_node: int = 4 | |
# Plotting the linear line | ||
num_gpus = np.array(avg_epoch_time_df["num_gpus"].unique()) | ||
linear_speedup = np.array(avg_epoch_time_df["linear_speedup"].unique()) | ||
ax.plot(num_gpus, linear_speedup, ls="dashed", lw=1.0, c="k", label="linear speedup") | ||
ax.plot( | ||
num_gpus, linear_speedup, ls="dashed", lw=1.0, c="k", label="linear speedup" | ||
) | ||
|
||
ax.legend(ncol=1) | ||
ax.set_xticks(num_gpus) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
# -------------------------------------------------------------------------------------- | ||
# Part of the interTwin Project: https://www.intertwin.eu/ | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# -------------------------------------------------------------------------------------- | ||
|
||
import functools | ||
import time | ||
from multiprocessing import Manager, Process | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# -------------------------------------------------------------------------------------- | ||
# Part of the interTwin Project: https://www.intertwin.eu/ | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN Openlab | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# -------------------------------------------------------------------------------------- | ||
|
||
from typing import Tuple | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
# -------------------------------------------------------------------------------------- | ||
# Part of the interTwin Project: https://www.intertwin.eu/ | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# -------------------------------------------------------------------------------------- | ||
|
||
from typing import Any, List, Tuple | ||
|
||
import matplotlib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
from __future__ import annotations | ||
# -------------------------------------------------------------------------------------- | ||
# Part of the interTwin Project: https://www.intertwin.eu/ | ||
# | ||
# Created by: Jarl Sondre Sæther | ||
# | ||
# Credits: | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# -------------------------------------------------------------------------------------- | ||
|
||
import functools | ||
from pathlib import Path | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.