Skip to content

Commit

Permalink
last revert
Browse files Browse the repository at this point in the history
  • Loading branch information
milocress committed Apr 18, 2024
1 parent e6edad1 commit a59299c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/models/hf/test_hf_v_mpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def test_compare_hf_v_mpt(attn_impl: str, dropout: float, alibi: bool,
print(model_cfg)
model = build_composer_model(
name=model_cfg.name,
tokenizer=tokenizer,
cfg=model_cfg,
tokenizer=tokenizer,
).to(device)
n_params = sum(p.numel() for p in model.parameters())

Expand Down
2 changes: 1 addition & 1 deletion tests/models/layers/test_huggingface_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def test_flash2(model_name: str, use_flash_attention_2: bool, init_device: str):
with error_context:
model = build_composer_model(
name=model_cfg['name'],
tokenizer=tokenizer,
cfg=model_cfg,
tokenizer=tokenizer,
)

# check that it actually used flash attention 2
Expand Down
12 changes: 6 additions & 6 deletions tests/models/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def _get_objs(request: pytest.FixtureRequest,

model = build_composer_model(
name=test_cfg.model.name,
tokenizer=tokenizer,
cfg=test_cfg.model,
tokenizer=tokenizer,
)

# Optimizer
Expand Down Expand Up @@ -293,8 +293,8 @@ def test_full_forward_and_backward_gpt2_small(batch_size: int = 2):

model = build_composer_model(
name=neo_cfg.model.name,
tokenizer=tokenizer,
cfg=neo_cfg.model,
tokenizer=tokenizer,
).to(device)

assert isinstance(model.tokenizer,
Expand Down Expand Up @@ -342,8 +342,8 @@ def test_full_forward_and_backward_t5_small(batch_size: int = 2):

model = build_composer_model(
name=t5_cfg.model.name,
tokenizer=tokenizer,
cfg=t5_cfg.model,
tokenizer=tokenizer,
).to(device)

assert isinstance(model.tokenizer,
Expand Down Expand Up @@ -419,8 +419,8 @@ def test_determinism(attn_impl: str, precision: torch.dtype, ffn_type: str,

model_1 = build_composer_model(
name=test_cfg.model.name,
tokenizer=tokenizer,
cfg=test_cfg.model,
tokenizer=tokenizer,
)
model_2 = copy.deepcopy(model_1)

Expand Down Expand Up @@ -489,8 +489,8 @@ def test_loss_fn():

model_1 = build_composer_model(
name=test_cfg.model.name,
tokenizer=tokenizer,
cfg=test_cfg.model,
tokenizer=tokenizer,
)
model_2 = copy.deepcopy(model_1)

Expand Down Expand Up @@ -575,8 +575,8 @@ def test_loss_reduction(loss_fn_config: str):

model_1 = build_composer_model(
name=test_cfg.model.name,
tokenizer=tokenizer,
cfg=test_cfg.model,
tokenizer=tokenizer,
)
model_2 = copy.deepcopy(model_1)

Expand Down

0 comments on commit a59299c

Please sign in to comment.