Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ you can see the sample [fil read in csv](./samples/charts/sbk-file-read.csv) and

### Setup Instructions

#### Setup with Python virtual environment

```
#create the env
python3 -m venv venv-sbk-charts
Expand All @@ -123,6 +125,31 @@ to deactivate from the venv
deactivate
```

#### Setup with conda

```
# Create a new conda environment with Python 3.14 or higher
conda create -n conda-sbk-charts python=3.14 -y
Comment on lines +131 to +132
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Python 3.14 does not exist yet.

Python 3.14 is not released (current stable versions are 3.12/3.13). This will cause conda environment creation to fail. Consider using Python 3.12 or 3.13.

Proposed fix
-# Create a new conda environment with Python 3.14 or higher
-conda create -n conda-sbk-charts python=3.14 -y
+# Create a new conda environment with Python 3.12 or higher
+conda create -n conda-sbk-charts python=3.12 -y
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Create a new conda environment with Python 3.14 or higher
conda create -n conda-sbk-charts python=3.14 -y
# Create a new conda environment with Python 3.12 or higher
conda create -n conda-sbk-charts python=3.12 -y
🤖 Prompt for AI Agents
In `@README.md` around lines 131 - 132, The README currently pins a non-existent
Python version in the conda create command ("conda create -n conda-sbk-charts
python=3.14 -y"); update that command to use a released interpreter (e.g.,
python=3.12 or python=3.13) so environment creation succeeds, and optionally
note a range like "python>=3.12,<3.14" or "python=3.12" for clarity.


# Activate the environment
conda activate conda-sbk-charts

# Install pip if not already installed
conda install pip -y

# Install the project in editable mode using pip
pip install -e .

# Build the sbk-charts package
python -m build
```

To deactivate

```
conda deactivate
```

## Generative AI-Powered Analysis

SBK Charts includes AI-powered analysis descriptions to provide deeper insights into your storage benchmark results.
Expand Down
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ ordered-set~=4.1.0
jproperties~=2.1.1
pillow~=12.0.0
openpyxl-image-loader~=1.0.5
huggingface_hub~=1.2.3
huggingface_hub~=0.34.0
build~=1.3.0
lmstudio~=1.5.0
openai~=2.14.0
requests~=2.32.5
requests~=2.32.5
torch~=2.9.1
transformers~=4.57.3
Comment on lines +13 to +14
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check latest available versions of torch and transformers on PyPI
echo "Checking torch versions:"
curl -s https://pypi.org/pypi/torch/json | jq -r '.releases | keys | .[-15:]' | sort -V

echo -e "\nChecking transformers versions:"
curl -s https://pypi.org/pypi/transformers/json | jq -r '.releases | keys | .[-15:]' | sort -V

Repository: kmgowda/sbk-charts

Length of output: 469


Fix invalid transformers version in requirements.txt.

Line 14 specifies transformers~=4.57.3, but this version does not exist on PyPI. Available versions jump from 4.9.2 to 4.57.4. Update to transformers~=4.57.4 or later.

The torch~=2.9.1 version is valid and exists on PyPI.

🤖 Prompt for AI Agents
In `@requirements.txt` around lines 13 - 14, The requirements.txt entry for
transformers is pinned to a non-existent version "transformers~=4.57.3"; update
that token to a valid release (e.g., change "transformers~=4.57.3" to
"transformers~=4.57.4" or a later valid version) while leaving "torch~=2.9.1"
unchanged so pip can resolve packages correctly.

accelerate>=0.20.0 # Required for model parallelism and memory optimization
Binary file modified samples/charts/.DS_Store
Binary file not shown.
Binary file not shown.
62 changes: 42 additions & 20 deletions src/ai/sbk_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,26 @@
# Log the full exception for debugging
import traceback

# Excel formatting constants
class ExcelColors:
RED_BOLD = "FFFF0000"
GREEN = "00CF00"
PURPLE = "EE00FF"
DARK_RED = "FF800000"
GREEN_HEADER = "00AA00"
DARK_BLUE = "FF000080"
BLUE = "0000FF"
DARK_GREEN = "008000"
DARK_MAGENTA = "8B008B"
SADDLE_BROWN = "8B4513"
TITLE_RED = "FF0000"

# Warning message about AI-generated content reliability
warning_msg = ("The AI may hallucinate !. "
"The summary generated by generative AI models may not be complete and accurate. "
"It's recommended to analyze the graphs along with the generated summary.")

DEFAULT_TIMEOUT_SECONDS = 120

def get_t_num_sheet_name(r_num_name):
"""
Expand Down Expand Up @@ -134,7 +149,7 @@ def __init__(self):
self.file = None
self.ai_instance = None
self.web = None
self.timeout_seconds = 120
self.timeout_seconds = DEFAULT_TIMEOUT_SECONDS
self.no_threads = False

def add_args(self, parser):
Expand All @@ -155,7 +170,7 @@ def add_args(self, parser):
default=self.timeout_seconds)
parser.add_argument("-nothreads", "--nothreads", help=f"No parallel threads, default : {self.no_threads}",
default=self.no_threads)
self.subparsers = parser.add_subparsers(dest="ai_class", help="Available sub-commands", required=False)
self.subparsers = parser.add_subparsers(dest="ai_class", help="Available GenAI commands", required=False)
parser.set_defaults(ai_class=None)
for name, cls in self.classes.items():
try:
Expand All @@ -177,19 +192,27 @@ def parse_args(self, args):

Args:
args (argparse.Namespace): Parsed command-line arguments

Side Effects:
- Sets the output file path
- Configures timeout and threading settings
- Configures timeout (converted to int) and threading settings
- Activates the selected AI backend instance if specified
"""
self.timeout_seconds = int(args.seconds) if hasattr(args, 'seconds') and args.seconds is not None else DEFAULT_TIMEOUT_SECONDS
self.file = args.ofile
self.timeout_seconds = args.seconds
self.no_threads = args.nothreads
if args.ai_class:
self.ai_instance = self.ai_instance_map[args.ai_class.lower()]
self.ai_instance.parse_args(args)

def open(self, args):
if self.ai_instance:
self.ai_instance.open(args)

def close(self, args):
if self.ai_instance:
self.ai_instance.close(args)

def load_workbook(self):
"""
Load the Excel workbook from the specified file path.
Expand Down Expand Up @@ -399,12 +422,11 @@ def run_analysis(function_name):

print(f"Analysis completed in {time.time() - start_time:.2f} seconds", flush=True)


# Format and add AI analysis to the worksheet
# Format and add AI analysis to the worksheet
try:
sheet = self.wb["Summary"]

# Configure column H width to accommodate 120 characters
# Configure column H width to accommodate text
sheet.column_dimensions['H'].width = 120 * 0.90

# Add AI warning section with proper formatting
Expand All @@ -413,7 +435,7 @@ def run_analysis(function_name):
# Format and add the warning message
warn_cell = sheet.cell(row=max_row, column=8)
warn_cell.value = warning_msg
warn_cell.font = Font(size=16, bold=True, color="FFFF0000") # Red bold text
warn_cell.font = Font(size=16, bold=True, color=ExcelColors.RED_BOLD)
warn_cell.alignment = Alignment(wrap_text=True, vertical='top')

# Calculate optimal row height for the warning message
Expand All @@ -429,24 +451,24 @@ def run_analysis(function_name):
max_row = sheet.max_row + 2
title_cell = sheet.cell(row=max_row, column=7)
title_cell.value = "AI Performance Analysis"
title_cell.font = Font(size=18, bold=True, color="FF0000")
title_cell.font = Font(size=18, bold=True, color=ExcelColors.TITLE_RED)

# Add model description
dec_cell = sheet.cell(row=max_row, column=8)
dec_cell.value = self.ai_instance.get_model_description()[1]
dec_cell.font = Font(size=16, color="00CF00") # Green text for model info
dec_cell.font = Font(size=16, color=ExcelColors.GREEN)

# Add Throughput Analysis section
throughput_header_row = max_row + 2
cell = sheet.cell(row=throughput_header_row, column=7)
cell.value = "Throughput Analysis"
cell.font = Font(size=16, bold=True, color="EE00FF") # Purple header
cell.font = Font(size=16, bold=True, color=ExcelColors.PURPLE)

# Add throughput analysis content with formatting
cell = sheet.cell(row=throughput_header_row, column=8)
throughput_analysis = results['get_throughput_analysis'][1]
cell.value = throughput_analysis
cell.font = Font(size=14, color="FF800000") # Dark red text
cell.font = Font(size=14, color=ExcelColors.DARK_RED)
cell.border = Border(
left=Side(style='thin'),
right=Side(style='thin'),
Expand All @@ -469,13 +491,13 @@ def run_analysis(function_name):
# Format and add latency analysis header
cell = sheet.cell(row=latency_row, column=7)
cell.value = "Latency Analysis"
cell.font = Font(size=16, bold=True, color="00AA00") # Green header
cell.font = Font(size=16, bold=True, color=ExcelColors.GREEN_HEADER)

# Add latency analysis content with formatting
cell = sheet.cell(row=latency_row, column=8)
latency_analysis = results['get_latency_analysis'][1]
cell.value = latency_analysis
cell.font = Font(size=14, color="FF000080") # Dark blue text
cell.font = Font(size=14, color="FF000080")
cell.border = Border(
left=Side(style='thin'),
right=Side(style='thin'),
Expand All @@ -498,13 +520,13 @@ def run_analysis(function_name):
# Format and add total MB analysis header
cell = sheet.cell(row=mb_row, column=7)
cell.value = "Total MB Analysis"
cell.font = Font(size=16, bold=True, color="0000FF") # Blue header
cell.font = Font(size=16, bold=True, color=ExcelColors.BLUE)

# Add total MB analysis content with formatting
cell = sheet.cell(row=mb_row, column=8)
mb_analysis = results['get_total_mb_analysis'][1]
cell.value = mb_analysis
cell.font = Font(size=14, color="008000") # Green text
cell.font = Font(size=14, color=ExcelColors.DARK_GREEN)
cell.border = Border(
left=Side(style='thin'),
right=Side(style='thin'),
Expand All @@ -527,13 +549,13 @@ def run_analysis(function_name):
# Format and add percentile histogram analysis header
cell = sheet.cell(row=percentile_row, column=7)
cell.value = "Percentile Histogram Analysis"
cell.font = Font(size=16, bold=True, color="8B008B") # Dark magenta header
cell.font = Font(size=16, bold=True, color=ExcelColors.DARK_MAGENTA)

# Add percentile histogram analysis content with formatting
cell = sheet.cell(row=percentile_row, column=8)
percentile_analysis = results['get_percentile_histogram_analysis'][1]
cell.value = percentile_analysis
cell.font = Font(size=14, color="8B4513") # Saddle brown text
cell.font = Font(size=14, color=ExcelColors.SADDLE_BROWN)
cell.border = Border(
left=Side(style='thin'),
right=Side(style='thin'),
Expand All @@ -553,7 +575,7 @@ def run_analysis(function_name):
except Exception as e:
print(f"Error adding analysis to summary sheet: {str(e)}")
traceback.print_exc()

return True

def add_performance_details(self):
Expand Down
Loading