Skip to content
Draft
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
142 changes: 142 additions & 0 deletions docs/source/_static/announcements.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/* Scoped announcement styles for the Sphinx RTD theme. */

#announcements > h1,
#announcements > p,
.announcement-section {
max-width: 860px;
margin-left: auto;
margin-right: auto;
}

.announcement-section {
width: 100%;
}

.announcement-toolbar {
border: 1px solid #d6d8dc;
border-radius: 4px;
margin: 1.5rem 0;
padding: 1rem;
background: #f8f9fb;
}

.announcement-search-label {
display: block;
font-weight: 700;
margin-bottom: 0.35rem;
}

.announcement-search {
box-sizing: border-box;
width: 100%;
padding: 0.55rem 0.65rem;
border: 1px solid #b8bdc6;
border-radius: 4px;
font-size: 1rem;
}

.announcement-tags {
display: flex;
flex-wrap: wrap;
gap: 0.45rem;
margin-top: 0.75rem;
}

.announcement-tag {
border: 1px solid #9aa1ad;
border-radius: 999px;
padding: 0.28rem 0.65rem;
background: #fff;
color: #2f343d;
cursor: pointer;
font-size: 0.86rem;
}

.announcement-tag.is-active,
.announcement-tag:hover {
border-color: #76b900;
background: #76b900;
color: #111;
}

.announcement-grid {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 1rem;
margin: 1rem 0 1.25rem;
}

.announcement-card {
border-bottom: 1px solid #d6d8dc;
padding: 0 0 1rem;
}

.announcement-card:last-child {
border-bottom: 0;
}

.announcement-card h2 {
margin-top: 0.25rem;
font-size: 1.2rem;
line-height: 1.35;
}

.announcement-card p {
margin-bottom: 0.75rem;
}

.announcement-card-meta {
color: #6b7280;
font-size: 0.85rem;
}

.announcement-card-tags {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
}

.announcement-card-tags span {
border: 1px solid #d6d8dc;
border-radius: 999px;
color: #4b5563;
font-size: 0.78rem;
padding: 0.15rem 0.45rem;
}

.announcement-empty {
border-left: 4px solid #76b900;
padding-left: 0.75rem;
}


.announcement-pager {
align-items: center;
display: flex;
gap: 0.75rem;
justify-content: flex-end;
margin: 0 0 2rem;
}

.announcement-page-button {
border: 1px solid #9aa1ad;
border-radius: 4px;
background: #fff;
color: #2f343d;
cursor: pointer;
padding: 0.35rem 0.7rem;
}

.announcement-page-button:disabled {
cursor: not-allowed;
opacity: 0.45;
}

.announcement-page-status {
color: #4b5563;
font-size: 0.9rem;
}

.toctree-wrapper.compound:empty {
display: none;
}
105 changes: 105 additions & 0 deletions docs/source/_static/announcements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
document.addEventListener('DOMContentLoaded', () => {
const trimAnnouncementPostSidebar = () => {
if (!window.location.pathname.includes('/announcements/')) {
return;
}

const menu = document.querySelector('.wy-menu-vertical');
if (!menu) {
return;
}

menu.innerHTML = `
<p class="caption" role="heading"><span class="caption-text">Announcements</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../index.html">Announcements</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/1_modelopt_api.html">API Docs</a></li>
</ul>
`;
};

trimAnnouncementPostSidebar();

const search = document.querySelector('#announcement-search');
const cards = Array.from(document.querySelectorAll('.announcement-card')).sort((left, right) => {
return (right.dataset.date || '').localeCompare(left.dataset.date || '');
});
const tags = Array.from(document.querySelectorAll('.announcement-tag'));
const empty = document.querySelector('#announcement-empty');
const pager = document.querySelector('#announcement-pager');
const prev = document.querySelector('#announcement-prev');
const next = document.querySelector('#announcement-next');
const status = document.querySelector('#announcement-page-status');
const pageSize = 5;

cards.forEach((card) => card.parentNode.appendChild(card));
let activeTag = 'all';
let currentPage = 1;

if (!search || cards.length === 0) {
return;
}

const matchingCards = () => {
const query = search.value.trim().toLowerCase();
return cards.filter((card) => {
const haystack = [card.dataset.title, card.dataset.summary, card.dataset.tags].join(' ').toLowerCase();
const tagMatch = activeTag === 'all' || (card.dataset.tags || '').split(' ').includes(activeTag);
const searchMatch = !query || haystack.includes(query);
return tagMatch && searchMatch;
});
};

const update = () => {
const matches = matchingCards();
const pageCount = Math.max(1, Math.ceil(matches.length / pageSize));
currentPage = Math.min(currentPage, pageCount);
const start = (currentPage - 1) * pageSize;
const pageCards = new Set(matches.slice(start, start + pageSize));

cards.forEach((card) => {
card.hidden = !pageCards.has(card);
});

if (empty) {
empty.hidden = matches.length !== 0;
}

if (pager && prev && next && status) {
pager.hidden = matches.length <= pageSize;
prev.disabled = currentPage <= 1;
next.disabled = currentPage >= pageCount;
status.textContent = `Page ${currentPage} of ${pageCount}`;
}
};

tags.forEach((button) => {
button.addEventListener('click', () => {
activeTag = button.dataset.tag || 'all';
currentPage = 1;
tags.forEach((tag) => tag.classList.toggle('is-active', tag === button));
update();
});
});

search.addEventListener('input', () => {
currentPage = 1;
update();
});

if (prev) {
prev.addEventListener('click', () => {
currentPage -= 1;
update();
});
}

if (next) {
next.addEventListener('click', () => {
currentPage += 1;
update();
});
}

update();
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The effective bits is misleading in the fig, the NVFP4 has effective bits=4.5, we state this clearly in the nvfp4 config, so we cannot achieve an effective bits=4.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's also better to link to reproducible recipes for users want to try.

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.
Loading