Skip to content

quantization files for table results#58

Open
anantr37 wants to merge 2 commits intomainfrom
quantization_table_results
Open

quantization files for table results#58
anantr37 wants to merge 2 commits intomainfrom
quantization_table_results

Conversation

@anantr37
Copy link
Collaborator

Quantization files (for Moment and LPTM) to create tables for VLDB paper. Should be run with GPU.

CPU results:

LPTM Results (ETTh1, Horizon=192)

Float32  | MSE: 1.04811 | Size: 491.96 MB | Speedup: 1.0x
Float16  | MSE: 1.04811 | Size: 246.00 MB | Speedup: 0.28x
INT8     | MSE: 1.04816 | Size: 209.10 MB | Speedup: 0.44x

MOMENT Results (ETTh1, Horizon=192)

Float32  | MSE: 0.11024 | Size: 1435.86 MB | Speedup: 1.0x
Float16  | MSE: 0.11024 | Size: 717.97 MB | Speedup: 0.17x
INT8     | MSE: 0.11024 | Size: 474.45 MB | Speedup: 0.41x

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds quantization experiment scripts (Moment + LPTM) intended to generate VLDB table results, and updates the core library to support quantization workflows.

Changes:

  • Add two example scripts to measure MSE / model size / inference time across FP32/FP16/INT8 (with optional CUDA bitsandbytes INT8).
  • Add bitsandbytes to project dependencies.
  • Modify src/samay/model.py quantization helper and reformat several method signatures/lines.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/samay/model.py Introduces a local quantize_linear_layers() and uses it from model quantize() methods; also contains formatting-only changes.
src/samay/dataset.py Removes an assignment to self.freq in BaseDataset.__init__.
pyproject.toml Adds bitsandbytes to dependencies.
example/moment_quantize_table_results.py New script to run Moment quantization experiments (FP32/FP16/INT8).
example/lptm_quantize_table_results.py New script to run LPTM quantization experiments (FP32/FP16/INT8).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 1317 to +1323
def quantize(self, quant_type="int8", device="cuda"):
self.model.eval()
self.model = self.model.to(device)
with torch.no_grad():
self.model = quantize_linear_layers(self.model, quantization_type=quant_type)
self.model = quantize_linear_layers(
self.model, quantization_type=quant_type
)
Comment on lines 1781 to +1787
def quantize(self, quant_type="int8", device="cuda"):
self.model.eval()
self.model = self.model.to(device)
with torch.no_grad():
self.model = quantize_linear_layers(self.model, quantization_type=quant_type)
self.model = quantize_linear_layers(
self.model, quantization_type=quant_type
)
"torchvision>=0.20.1",
"lightning>=2.5.1",
"plotly>=6.3.0",
"bitsandbytes>=0.49.2",
Comment on lines +145 to +152
val_dataset = MomentDataset(
name="ett",
datetime_col="date",
path="./src/samay/models/moment/data/ETTh1.csv",
mode="test",
horizon_len=192,
freq=None,
)
Comment on lines +153 to +159
train_dataset = LPTMDataset(
name="ett",
datetime_col="date",
path="./data/data/ETTh1.csv",
mode="train",
horizon=192,
)
Comment on lines +161 to +167
val_dataset = LPTMDataset(
name="ett",
datetime_col="date",
path="./data/data/ETTh1.csv",
mode="test",
horizon=192,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants