Skip to content

Add integration tests with real models #11

@MaxGhenis

Description

@MaxGhenis

Description

Add integration tests using real architectures (ResNet, VGG, Transformer) to ensure L0 works with production models.

Motivation

Unit tests cover individual components, but we need to verify L0 works with complete, real-world architectures.

Test Cases

# tests/integration/test_resnet.py
def test_resnet18_cifar10():
    model = torchvision.models.resnet18(num_classes=10)
    model = add_l0_to_model(model, init_sparsity=0.5)
    
    # Train for 1 epoch on small subset
    train_loader = get_cifar10_subset(100)
    train_one_epoch(model, train_loader)
    
    # Verify:
    # - Forward/backward passes work
    # - Sparsity is being learned
    # - Loss decreases
    
# tests/integration/test_transformer.py  
def test_bert_tiny():
    # Test with tiny BERT model
    ...

Models to Test

  • ResNet (18, 50)
  • VGG
  • MobileNet
  • BERT/GPT-2 (tiny versions)
  • Simple CNN/RNN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions