jax-ml/jax · error · ValueError
Character '.' must be used inside ellipsis '...'
Error message
Character '.' must be used inside ellipsis '...'
What it means
Raised while normalizing a sharding rule: the parser first rewrites '...' into a BATCHING token; any remaining '.' in the rule is a stray character that is not part of an ellipsis and is therefore rejected.
Solutions
- Fix the ellipsis to be exactly '...' or remove the stray dot
- Ensure factor names contain no '.' characters
Example fix
# before rule = '..i,j->j' # after rule = '...i,j->j'
Defensive patterns
Strategy: validation
Validate before calling
assert '..' not in rule.replace('...', ''), 'dots only allowed inside ...' Type guard
def dots_only_in_ellipsis(rule: str) -> bool:
return '.' not in rule.replace('...', '') Prevention
- Type ellipsis as exactly three dots; grep rules for stray '.' in review
When it happens
Trigger: Rule like 'i.j->j', '..i->i' (two dots), or '...i.j' with a stray dot.
Common situations: Typos when typing ellipsis (two or four dots); einsum habits where '.' never appears; filesystem-like names in factor names.
Related errors
- Brackets are not balanced
- Brackets are not balanced in rule
- Brackets should contain at least two factors
- Compound factors should be one level, nested brackets are…
- Factor names have to start with a letter, but got
AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27).
Data as JSON: /api/errors/71fad57962c3ca35.
Report an issue: GitHub.
Appendix: source
Thrown at jax/_src/custom_partitioning_sharding_rule.py:347
permutation_factors: A tuple of factors that are permutation factors.
**factor_sizes: The optional factor sizes.
Raises:
ValueError: If there is any problem with the rule or factor_sizes.
"""
if not isinstance(rule, str):
raise TypeError(f"rule must be a str, but got {type(rule)}")
if not all(isinstance(size, int) for size in factor_sizes.values()):
raise TypeError(
f"factor_sizes must be a dict of str to int, but got {factor_sizes}")
# Replace ... with a single char to simplify parsing.
if BATCHING in rule:
raise ValueError(f"Unknown character '{BATCHING}'")
if "." in rule:
rule = rule.replace("...", BATCHING)
if "." in rule:
raise ValueError("Character '.' must be used inside ellipsis '...'")
try:
operands, results = rule.split("->")
except ValueError as e:
raise ValueError(f"There is no -> in rule: '{rule}'") from e
operand_mappings = _parse_values(operands)
result_mappings = _parse_values(results)
return SdyShardingRule(operand_mappings, result_mappings,
reduction_factors=reduction_factors,
need_replication_factors=need_replication_factors,
permutation_factors=permutation_factors,
**factor_sizes)
def sdy_sharding_rule_to_mlir(
rule: SdyShardingRule,
operand_types: list[ir.Type],View on GitHub (pinned to 1e1c6a8fc0)