MoE kernels AGPLv3

This commit is contained in:
Daniel Han 2025-07-06 22:44:35 -07:00
commit 050e188cf6
15 changed files with 42 additions and 0 deletions

View file

@ -1,6 +1,7 @@
## MoE Grouped GEMM
Optimized implementation of `MoE MLP Block`.
Licensed under AGPLv3.
### Background

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import logging
import warnings
from dataclasses import asdict

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
"""
Autotuning utils
"""

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import torch
import triton
import triton.language as tl

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import torch
import triton
import triton.language as tl

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
"""
Manual tuning utils
"""

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
from dataclasses import dataclass
from typing import Tuple

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
from dataclasses import dataclass
from typing import Tuple

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import torch
from transformers.models.qwen3_moe.configuration_qwen3_moe import Qwen3MoeConfig
from transformers.models.qwen3_moe.modeling_qwen3_moe import Qwen3MoeSparseMoeBlock

View file

@ -1,3 +1,5 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import torch
import torch.nn.functional as F

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import itertools
from contextlib import contextmanager
from dataclasses import dataclass, field

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
from dataclasses import dataclass, fields
import torch

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
from dataclasses import asdict
import pytest

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import argparse
import sys
from contextlib import contextmanager

View file

@ -1,3 +1,6 @@
# SPDX-License-Identifier: GNU Affero General Public License v3.0
# Copyright 2023-present the Unsloth team. All rights reserved.
import argparse
from contextlib import contextmanager