[Fix] Allow default TIS function usage when get_mismatch_metrics is set #1483
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses a logical conflict between
slime/utils/arguments.pyandslime/backends/megatron_utils/loss.py.Motivation
Previously,
slime_validate_argsenforced a strict assertion thatcustom_tis_function_pathmust be provided whenget_mismatch_metricsis enabled. However, the backend logic inloss.pyexplicitly supports a fallback tovanilla_tis_functionwhen no custom path is provided.Since
vanilla_tis_functioncorrectly computes and returns metrics (e.g.,tis,tis_clipfrac), the previous assertion unnecessarily prevented users from observing mismatch metrics using the default implementation.Modification
slime/utils/arguments.pywith a warning.get_mismatch_metricsis set without a custom path, the system warns the user (for visibility) and correctly falls back to the default TIS function instead of raising an error.