python_code
stringlengths
0
679k
repo_name
stringlengths
9
41
file_path
stringlengths
6
149
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
FasterTransformer-main
examples/tensorflow/xlnet/convertInput.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
FasterTransformer-main
examples/tensorflow/xlnet/modeling.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
FasterTransformer-main
examples/tensorflow/xlnet/convertModel.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
FasterTransformer-main
examples/pytorch/nemo.py
FasterTransformer-main
examples/pytorch/__init__.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
FasterTransformer-main
examples/pytorch/tokenizer.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
FasterTransformer-main
examples/pytorch/utils.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/swin/checkpoint_quantization.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/swin/infer_swintransformer_int8_op.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/swin/infer_swintransformer_op.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/swin/SwinTransformerWeightTransposeQKVWeight.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/swin/SwinTransformerINT8Weight.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/swin/infer_swintransformer_acc.py
from SwinTransformer.config import get_config
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/__init__.py
# coding=utf-8 # Copyright (c) 2019-2022 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/quant_utils.py
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # ...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/main.py
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # ...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/data.py
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- from .swin_transformer import SwinTransformer from .swin_transformer_v2 ...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/models/build.py
from .build import build_model
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/models/__init__.py
# -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/models/linear_activation.py
# -------------------------------------------------------- # Swin Transformer V2 # Copyright (c) 2022 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. #...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/models/swin_transformer_v2.py
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # ...
FasterTransformer-main
examples/pytorch/swin/Swin-Transformer-Quantization/models/swin_transformer.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/bloom_lambada.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2021, NAVER Corp. Authored by CLOVA. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
FasterTransformer-main
examples/pytorch/gpt/gpt_example.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/opt_summarization.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/lambada_task_example.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2021, NAVER Corp. Authored by CLOVA. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
FasterTransformer-main
examples/pytorch/gpt/multi_gpu_gpt_example.py
# Modify from https://github.com/NVIDIA/Megatron-LM/blob/main/tasks/zeroshot_gpt/evaluate.py # coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
FasterTransformer-main
examples/pytorch/gpt/evaluate_zeroshot_gpt.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/gpt_summarization.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/gpt_token_converter.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/comm.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/megatron_fp8_ckpt_convert.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/huggingface_jp_gpt_convert.py
#!/usr/bin/env python3 # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
FasterTransformer-main
examples/pytorch/gpt/utils/update_gpt_config.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/huggingface_gpt_convert.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/generate_start_ids.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/word_list.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/gpt_fp8.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/generate_gpt_config.py
import os import sys import numpy as np import torch # Example # python tools/checkpoint_util.py --model-type GPT --loader megatron --saver fastertransformer \ # --input /home/scratch.bhsueh_sw/megatron_new_ckpt/357m-pipeline-2-tensor-2/ --output ./tmp --target-tensor-parallel-size 2 def add_arguments(parser): ...
FasterTransformer-main
examples/pytorch/gpt/utils/checkpoint_saver_fastertransformer.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/nemo_ckpt_convert.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
FasterTransformer-main
examples/pytorch/gpt/utils/tokenizer.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/megatron_ckpt_convert.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/huggingface_opt_convert.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/huggingface_bloom_convert.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/gpt_decoder.py
import time class Timer: def __init__(self): self._start_times = {} self._total_elapsed_times = {} def start(self, tag): self._start_times[tag] = time.time() def stop(self, tag): elapsed_time = time.time() - self._start_times[tag] if tag not in self._total_elapse...
FasterTransformer-main
examples/pytorch/gpt/utils/profiler.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/parallel_gpt.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/megatron_gpt_moe_ckpt_convert.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/gpt.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gpt/utils/bloom.py
"""Byte pair encoding utilities""" # Modified MIT License # Software Copyright (c) 2019 OpenAI # We don’t claim ownership of the content you create with GPT-2, so it is yours to do with as you please. # We only ask that you use GPT-2 responsibly and clearly indicate your content was created using GPT-2. # Permissio...
FasterTransformer-main
examples/pytorch/gpt/utils/gpt_token_encoder.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/encoder/encoder_example.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/encoder/utils/ft_encoder.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2021, NAVER Corp. Authored by CLOVA. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
FasterTransformer-main
examples/pytorch/gptneox/gptneox_example.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gptneox/utils/huggingface_jp_gptneox_convert.py
#! /usr/bin/env python3 # Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
FasterTransformer-main
examples/pytorch/gptneox/utils/hftokenizer.py
#! /usr/bin/env python3 # Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
FasterTransformer-main
examples/pytorch/gptneox/utils/eleutherai_gpt_neox_convert.py
import argparse import configparser import multiprocessing import os import shutil from pathlib import Path import numpy as np import torch from transformers import GPTNeoXForCausalLM def get_weight_data_type(data_type): if data_type == "fp32": return np.float32 elif data_type == "fp16": retu...
FasterTransformer-main
examples/pytorch/gptneox/utils/huggingface_gptneox_convert.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/gptneox/utils/gptneox.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoder/decoder_example.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoder/utils/ft_decoder.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoder/utils/decoder.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/translate_example.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/xnli_task_example.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/perf_benchmark.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/mnli_task_example.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/summarization.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/utils/megatron_t5_ckpt_convert.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/utils/ft_encoder.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/utils/nemo_t5_ia3.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/utils/ft_decoding.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/utils/huggingface_t5_ckpt_convert.py
import configparser import torch import argparse import os import numpy as np device = torch.device('cpu') encoder_config_mapping = { "num_attention_heads":"num_heads", "kv_channels":"d_kv", "hidden_size":"d_model", "ffn_hidden_size":"d_ff", "num_layers":"num_layers", "num_experts":"num_expert...
FasterTransformer-main
examples/pytorch/t5/utils/megatron-deepspeed_t5_ckpt_convert.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/t5/utils/nemo_t5_ckpt_convert.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
FasterTransformer-main
examples/pytorch/decoding/translate_example.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/decoding_example.py
# Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/utils/bleu_score.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/utils/__init__.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
FasterTransformer-main
examples/pytorch/decoding/utils/recover_bpe.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/utils/decoding.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/utils/ft_decoding.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/utils/translation_model.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/decoding/utils/translator.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/bart/translate_example.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/bart/utils/ft_encoder.py
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/bart/utils/ft_decoding.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/vit/checkpoint_quantization.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/vit/infer_visiontransformer_int8_op.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/vit/infer_visiontransformer_op.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/vit/VisionTransformerWeightLoader.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/vit/VisionTransformerINT8WeightLoader.py
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # ...
FasterTransformer-main
examples/pytorch/vit/ViT-quantization/config.py
# coding=utf-8 # Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
FasterTransformer-main
examples/pytorch/vit/ViT-quantization/eval_engine.py
# coding=utf-8 # Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
FasterTransformer-main
examples/pytorch/vit/ViT-quantization/vit_int8.py
# coding=utf-8 # Copyright (c) 2019-2022 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
FasterTransformer-main
examples/pytorch/vit/ViT-quantization/quant_utils.py
# coding=utf-8 # Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
FasterTransformer-main
examples/pytorch/vit/ViT-quantization/main.py
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- # Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. # # ...
FasterTransformer-main
examples/pytorch/vit/ViT-quantization/data.py
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
FasterTransformer-main
examples/pytorch/bert/bert_example.py
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
FasterTransformer-main
examples/pytorch/bert/run_glue.py