Skip to main content

LoadTime

English | 日本語

LoadTime is a Python package designed specifically to tackle the challenge of long waiting times associated with loading large-scale pretrained language models, such as HuggingFace models, into GPU or CPU memory.

With LoadTime, instead of waiting in uncertainty, you can visualize the progress of your loading process.

Of course, it can also be used for other long-term operations.

Installation

You can install LoadTime via pip:

pip install loadtime

Key Features

  • Real-time tracking: LoadTime provides real-time tracking of the loading process. No more staring at a static screen!

  • Progress Bar: The package displays a progress bar, showing you how much of the process has been completed and how much is still remaining. It takes the guesswork out of waiting!

  • Past Loading Time Cache: One unique feature of LoadTime is its ability to remember the time it took to load a model in the past. The package automatically caches the total loading time of your operations. The next time you load the same model, LoadTime uses this cached information to provide an even more accurate progress bar.

  • Customizable Display: LoadTime allows you to customize the progress display with your own messages. You can tailor the tool to fit your personal needs.

  • Optimized for HuggingFace Models: LoadTime has been optimized for loading HuggingFace models, with special handling of the download progress display when the model is not cached locally.

Basic Usage

Here is a simple example of how to use the LoadTime package:

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from loadtime import LoadTime

model_path = "togethercomputer/RedPajama-INCITE-Chat-3B-v1"

model = LoadTime(name=model_path,
                 fn=lambda: AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.float16))()

tokenizer = AutoTokenizer.from_pretrained(model_path) # important: load tokenizer after loading model

Initial Parameters

Parameter Description
name Name of the long-term process. For loading HuggingFace models, specify the model name.
message Specify the message to be displayed. If omitted, the default message is used.
pbar Set to True to display the progress bar and percentage.
dirname Directory name for cache storage.
hf Set to True to use for time display for loading HuggingFace models. If the model data has not yet been downloaded to the disk, HuggingFace's loader displays the download progress, so this library does not display it.
fn Function to execute the long-term process.
fn_print Function to perform the display. If omitted, it will be output to the console.

Take control of your loading times with LoadTime!

Release files for loadtime 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loadtime 1.0.6
File Size Uploaded
loadtime-1.0.6.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loadtime 1.0.6
File Interpreter ABI Platform
loadtime-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / loadtime-1.0.6.tar.gz

Download URL loadtime-1.0.6.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
085190662f45800706cd27fca85b1584831f29382455a06c7a8a659f8941e875
BLAKE2b-256 checksum
How to use checksums
92a6b4c795c144ac2a1c2163ed866e827fd69721b77e74e37bab6fa0166c2899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / loadtime-1.0.6-py3-none-any.whl

Download URL loadtime-1.0.6-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02d8dc2e76f17b56e64519818afc6ea8ac54914af33e6f7b982bee9abbf40b14
BLAKE2b-256 checksum
How to use checksums
dae4fb78bd32b52b2b250820b3a3f7b7be368bf094e52828b8e771b2c669992e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page