-
Notifications
You must be signed in to change notification settings - Fork 300
/
Copy pathcomm_mode_browser_visual.html
126 lines (108 loc) · 2.9 KB
/
comm_mode_browser_visual.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang ="en">
<head>
<meta charset="UTF-8">
<meta name = "viewport" content="width=device-width, initial-scale=1.0">
<title>CommDebugMode Module Tree</title>
<style>
ul, #tree-container {
list-style-type: none;
margin: 0;
padding: 0;
}
.caret {
cursor: pointer;
user-select: none;
}
.caret::before {
content: "\25B6";
color:black;
display: inline-block;
margin-right: 6px;
}
.caret-down::before {
transform: rotate(90deg);
}
.tree {
padding-left: 20px;
}
.tree ul {
padding-left: 20px;
}
/* hide nested list when component is not active*/
.nested {
display: none;
}
/* show nested list when pressed caret pointer makes component active*/
.active {
display: block;
}
.forward-pass,
.backward-pass {
margin-left: 40px;
}
.forward-pass table {
margin-left: 40px;
width: auto;
}
.forward-pass table td, .forward-pass table th {
padding: 8px;
}
.forward-pass ul {
display: none;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
#drop-area {
position: relative;
width: 25%;
height: 100px;
border: 2px dashed #ccc;
border-radius: 5px;
padding: 0px;
text-align: center;
}
.drag-drop-block {
display: inline-block;
width: 200px; /* reduce the width */
height: 50px; /* reduce the height */
background-color: #f7f7f7;
border: 1px solid #ccc;
border-radius: 5px;
padding: 10px; /* reduce the padding */
font-size: 14px; /* reduce the font size */
color: #666;
cursor: pointer;
}
#file-input {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
</style>
</head>
<body>
<div id="drop-area">
<div class="drag-drop-block">
<span>Drag file here</span>
</div>
<input type="file" id="file-input" accept=".json">
</div>
<div id="tree-container"></div>
<script src="https://cdn.jsdelivr.net/gh/pytorch/pytorch@main/torch/distributed/_tensor/debug/comm_mode_broswer_visual.js"></script>
</body>
</html>