Skip to content

Commit

Permalink
Revert "Ensure user sets backend to local w/ quantization (#3524)" (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaddair committed Aug 15, 2023
1 parent c9ab619 commit 90b8e4e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions ludwig/config_validation/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,6 @@ def _get_llm_model_config(model_name: str) -> AutoConfig:
def check_llm_quantization_backend_incompatibility(config: "ModelConfig") -> None: # noqa: F821
"""Checks that LLM model type with quantization uses the local backend."""
if config.backend is None:
if config.model_type == MODEL_LLM and config.quantization:
raise ConfigValidationError("LLM with quantization requires the 'local' backend to be set in the config.")
return

backend_type = config.backend.get("type", "local")
Expand Down
5 changes: 1 addition & 4 deletions tests/ludwig/config_validation/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@ def test_check_llm_quantization_backend_incompatibility():
ModelConfig.from_dict(config)

del config["backend"]
with pytest.raises(ConfigValidationError):
ModelConfig.from_dict(config)
ModelConfig.from_dict(config)

del config["quantization"]
config["backend"] = {"type": "ray"}
Expand All @@ -444,8 +443,6 @@ def test_check_qlora():
type: text
trainer:
type: finetune
backend:
type: local
"""
)

Expand Down
1 change: 0 additions & 1 deletion tests/ludwig/schema/test_model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ def test_llm_quantization_config(bits: Optional[int], expected_qconfig: Optional
"quantization": {"bits": bits},
INPUT_FEATURES: [{NAME: "text_input", TYPE: "text"}],
OUTPUT_FEATURES: [{NAME: "text_output", TYPE: "text"}],
"backend": {"type": "local"},
}

if bits is None:
Expand Down

0 comments on commit 90b8e4e

Please sign in to comment.