Skip to content

Commit 64fb38d

Browse files
FindHaofacebook-github-bot
authored andcommitted
Enhance UI styling for tab buttons and kernel selection (#12)
Summary: - Updated the styling of tab buttons in App.tsx to use a blue color scheme for active states, improving visibility and user experience. - Modified the layout of kernel buttons in KernelOverview.tsx to use a flexbox for better responsiveness and adjusted padding for improved aesthetics. Pull Request resolved: #12 Differential Revision: D76630971 Pulled By: FindHao fbshipit-source-id: 85a8eccbb3bc1f908ea0a53fd7c9b621b5d54c7a
1 parent e3da648 commit 64fb38d

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,14 @@ tritonparse.structured_logging.init(log_path)
102102
# === TritonParse init end ===
103103

104104
# The below is your original Triton/PyTorch 2 code
105-
# Example: Using with torch.compile
106-
def your_kernel():
107-
# Your PyTorch/Triton kernel code
108-
pass
109-
110-
compiled_kernel = torch.compile(your_kernel)
111-
result = compiled_kernel()
105+
...
112106

113107
# === TritonParse parse ===
114108
import tritonparse.utils
115109
tritonparse.utils.unified_parse(log_path)
116110
# === TritonParse parse end ===
117111
```
112+
See a full example in [`tests/test_add.py`](https://github.com/pytorch-labs/tritonparse/blob/main/tests/test_add.py).
118113

119114
### 2. Analyze with Web Interface
120115

website/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ function App() {
367367
{dataLoaded && kernels.length > 0 && !selectedIR && (
368368
<div className="flex space-x-4">
369369
<button
370-
className={`px-3 py-2 text-sm font-medium rounded-md ${activeTab === "overview" ? "bg-gray-100 text-gray-900" : "text-gray-500 hover:text-gray-700"
370+
className={`px-3 py-2 text-sm font-medium rounded-md ${activeTab === "overview" ? "bg-blue-700 text-white shadow-md" : "bg-blue-100 text-blue-700 hover:bg-blue-200"
371371
}`}
372372
onClick={() => {
373373
setActiveTab("overview");
@@ -384,7 +384,7 @@ function App() {
384384
Kernel Overview
385385
</button>
386386
<button
387-
className={`px-3 py-2 text-sm font-medium rounded-md ${activeTab === "comparison" ? "bg-gray-100 text-gray-900" : "text-gray-500 hover:text-gray-700"
387+
className={`px-3 py-2 text-sm font-medium rounded-md ${activeTab === "comparison" ? "bg-blue-700 text-white shadow-md" : "bg-blue-100 text-blue-700 hover:bg-blue-200"
388388
}`}
389389
onClick={() => {
390390
setActiveTab("comparison");

website/src/pages/KernelOverview.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ const KernelOverview: React.FC<KernelOverviewProps> = ({
9191
<h2 className="text-xl font-semibold mb-4 text-gray-800">
9292
Available Kernels
9393
</h2>
94-
<div className="grid grid-cols-1 gap-2">
94+
<div className="flex flex-wrap gap-2">
9595
{kernels.map((k, index) => (
9696
<button
9797
key={index}
98-
className={`p-3 text-left rounded-md transition-colors ${
98+
className={`px-4 py-2 text-sm rounded-md transition-colors whitespace-nowrap ${
9999
index === selectedKernel
100-
? "bg-blue-100 border border-blue-300"
101-
: "bg-gray-50 border border-gray-200 hover:bg-blue-50"
100+
? "bg-blue-100 border border-blue-300 text-blue-800"
101+
: "bg-gray-50 border border-gray-200 hover:bg-blue-50 text-gray-800"
102102
}`}
103103
onClick={() => onSelectKernel(index)}
104104
>
105-
<div className="font-medium text-gray-800">{k.name}</div>
105+
<div className="font-medium">{k.name}</div>
106106
</button>
107107
))}
108108
</div>

0 commit comments

Comments
 (0)