This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
import torch | |
import torch._dynamo.config | |
import triton | |
import triton.language as tl | |
torch._dynamo.config.cache_size_limit = 10000 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import contextlib | |
import math | |
import pathlib | |
from typing import List, Optional, Tuple, Union | |
import numpy as np | |
import torch | |
import torch.distributed as dist | |
import torch.nn as nn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import contextlib | |
import math | |
import pathlib | |
from typing import List, Optional, Tuple | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch.profiler._utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import contextlib | |
import math | |
import pathlib | |
from typing import List, Optional, Tuple | |
import numpy as np | |
import torch | |
import torch.distributed as dist | |
import torch.nn as nn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Benchmarking common shapes for Flux 1024x1024px image + varying text sequence lengths | |
import functools | |
import os | |
import pathlib | |
import matplotlib.pyplot as plt | |
import torch | |
import torch._dynamo.config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import contextlib | |
import math | |
from typing import List, Optional, Tuple | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch._inductor.config | |
import torch._higher_order_ops.auto_functionalize as af |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import contextlib | |
import math | |
from typing import List, Optional, Tuple | |
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch._inductor.config | |
import torch._higher_order_ops.auto_functionalize as af |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import contextlib | |
import functools | |
import inspect | |
import os | |
from enum import Enum | |
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union | |
FINETRAINERS_ATTN_CHECKS = os.environ.get("FINETRAINERS_ATTN_CHECKS", "0").lower() in ("1", "true", "yes") | |
FINETRAINERS_ATTN_PROVIDER = os.environ.get("FINETRAINERS_ATTN_PROVIDER", "native").lower() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: https://github.com/arcee-ai/mergekit/blob/488957e8e67c82861ecf63ef761f6bc59122dc74/mergekit/scripts/extract_lora.py | |
import argparse | |
import torch | |
from safetensors.torch import load_file, save_file | |
torch.backends.cuda.matmul.allow_tf32 = True | |
torch.backends.cudnn.allow_tf32 = True | |
torch.backends.cuda.preferred_linalg_library("cusolver") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.distributed as dist | |
from diffusers import AutoencoderKLWan, WanPipeline | |
from diffusers.utils import export_to_video | |
from finetrainers._metadata import ParamId, CPInput, CPOutput | |
from finetrainers.parallel.ptd import apply_context_parallel | |
from finetrainers.models.attention_dispatch import attention_provider, attention_dispatch | |
torch.nn.functional.scaled_dot_product_attention = attention_dispatch |
NewerOlder