Skip to content

Commit 05b47c8

Browse files
authored
[NFC] Fix installation steps and fix button sizes for custom opts (#2)
2 parents 4fde810 + 6c58ff4 commit 05b47c8

File tree

2 files changed

+47
-13
lines changed

2 files changed

+47
-13
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ tracing models through various IR stages and transformations.
2424

2525
## Known issues and limitations
2626

27-
- (PyTorch) The model and input tensor must be initialized in the provided code. If multiple models are defined, it is recommended to explicitly pair each model and its input tensor using the internal __explore__(model, input) function.
27+
- (PyTorch) The model and input tensor must be initialized in the provided code. If multiple models are defined, it is recommended to explicitly pair each model and its input tensor using the internal `__explore__(model, input)` function.
2828

29-
- (PyTorch) The current version does not recognize or capture user attempts to dump IR inside the input PyTorch module. It is planned that, in the future, if the user manually calls fx.export_and_import() (or similar IR-producing APIs), the app will use that IR as the base and apply the user-defined custom toolchain.
29+
- (PyTorch) The current version does not recognize or capture user attempts to dump IR inside the input PyTorch module. It is planned that, in the future, if the user manually calls `fx.export_and_import()` (or similar IR-producing APIs), the app will use that IR as the base and apply the user-defined custom toolchain.
3030

3131
- (Triton) The current implementation runs Triton kernels and retrieves IR dumps from the Triton cache directory. Timeout is set to 20s.
3232

@@ -45,11 +45,25 @@ Current version is tested on Ubuntu 22.04 windows subsystem using LLVM 21 dev.
4545

4646
### Install dependencies
4747

48+
In case of missing prerequisites here are some scripts to help set them up.
49+
4850
```bash
4951
git clone https://github.com/MrSidims/PytorchExplorer.git
5052
cd PytorchExplorer
51-
bash setup_frontend.sh
52-
bash setup_backend.sh
53+
source setup_frontend.sh
54+
```
55+
56+
When you have venv suitable for `torch-mlir` work, install `fastapi`, `uvicorn` etc in venv like this:
57+
58+
```bash
59+
pip install fastapi uvicorn pytest httpx
60+
```
61+
62+
Otherwise here is the script to setup `torch`, `llvm` etc:
63+
64+
65+
```bash
66+
source setup_backend.sh
5367
```
5468

5569
If you want to use your builds of the tools like `torch-mlir-opt`, `mlir-opt` etc without placing them in `PATH` please setup `TORCH_MLIR_OPT_PATH` and `LLVM_BIN_PATH` environment variables.

src/app/page.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,9 @@ export default function PyTorchTritonExplorer() {
632632
borderRadius: "5px",
633633
fontWeight: "bold",
634634
cursor: "pointer",
635-
height: "32px",
635+
whiteSpace: "nowrap",
636+
minHeight: "32px",
637+
flexShrink: 0,
636638
}}
637639
>
638640
torch-mlir-opt from this
@@ -648,7 +650,10 @@ export default function PyTorchTritonExplorer() {
648650
borderRadius: "5px",
649651
fontWeight: "bold",
650652
cursor: "pointer",
651-
height: "32px",
653+
fontSize: "0.65em",
654+
whiteSpace: "nowrap",
655+
minHeight: "32px",
656+
flexShrink: 0,
652657
}}
653658
>
654659
mlir-opt from this
@@ -666,7 +671,10 @@ export default function PyTorchTritonExplorer() {
666671
borderRadius: "5px",
667672
fontWeight: "bold",
668673
cursor: "pointer",
669-
height: "32px",
674+
fontSize: "0.65em",
675+
whiteSpace: "nowrap",
676+
minHeight: "32px",
677+
flexShrink: 0,
670678
}}
671679
>
672680
mlir-translate from this
@@ -682,7 +690,10 @@ export default function PyTorchTritonExplorer() {
682690
borderRadius: "5px",
683691
fontWeight: "bold",
684692
cursor: "pointer",
685-
height: "32px",
693+
fontSize: "0.65em",
694+
whiteSpace: "nowrap",
695+
minHeight: "32px",
696+
flexShrink: 0,
686697
}}
687698
>
688699
opt from this
@@ -698,7 +709,10 @@ export default function PyTorchTritonExplorer() {
698709
borderRadius: "5px",
699710
fontWeight: "bold",
700711
cursor: "pointer",
701-
height: "32px",
712+
fontSize: "0.65em",
713+
whiteSpace: "nowrap",
714+
minHeight: "32px",
715+
flexShrink: 0,
702716
}}
703717
>
704718
llc from this
@@ -716,7 +730,10 @@ export default function PyTorchTritonExplorer() {
716730
borderRadius: "5px",
717731
fontWeight: "bold",
718732
cursor: "pointer",
719-
height: "32px",
733+
fontSize: "0.65em",
734+
whiteSpace: "nowrap",
735+
minHeight: "32px",
736+
flexShrink: 0,
720737
}}
721738
>
722739
%your tool% in $PATH from this
@@ -744,12 +761,15 @@ export default function PyTorchTritonExplorer() {
744761
borderRadius: "5px",
745762
fontWeight: "bold",
746763
cursor: "pointer",
747-
height: "32px",
764+
fontSize: "0.65em",
765+
whiteSpace: "nowrap",
766+
minHeight: "32px",
767+
flexShrink: 0,
748768
}}
749769
>
750770
{window.dumpAfterEachOpt
751-
? "✓ Print IR after custom opts"
752-
: "Print IR after custom opts"}
771+
? "✓ Print IR after opts"
772+
: "Print IR after opts"}
753773
</button>
754774
</div>
755775
);

0 commit comments

Comments
 (0)