Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_quantized_training is flaky #6703

Open
StrikerRUS opened this issue Oct 29, 2024 · 2 comments
Open

test_quantized_training is flaky #6703

StrikerRUS opened this issue Oct 29, 2024 · 2 comments
Assignees
Labels

Comments

@StrikerRUS
Copy link
Collaborator

StrikerRUS commented Oct 29, 2024

Just noticed the test failure in master with cuda 11.8.0 pip (ubuntu20.04, clang, Python 3.11) job.

=================================== FAILURES ===================================
___________________________ test_quantized_training ____________________________

    def test_quantized_training():
        X, y = make_synthetic_regression()
        ds = lgb.Dataset(X, label=y)
        bst_params = {"num_leaves": 15, "verbose": -1, "seed": 0}
        bst = lgb.train(bst_params, ds, num_boost_round=10)
        rmse = np.sqrt(np.mean((bst.predict(X) - y) ** 2))
        bst_params.update(
            {
                "use_quantized_grad": True,
                "num_grad_quant_bins": 30,
                "quant_train_renew_leaf": True,
            }
        )
        quant_bst = lgb.train(bst_params, ds, num_boost_round=10)
        quant_rmse = np.sqrt(np.mean((quant_bst.predict(X) - y) ** 2))
>       assert quant_rmse < rmse + 6.0
E       assert np.float64(2988.108396382464) < (np.float64(24.313125588236623) + 6.0)

tests/python_package_test/test_engine.py:4579: AssertionError

def test_quantized_training():
X, y = make_synthetic_regression()
ds = lgb.Dataset(X, label=y)
bst_params = {"num_leaves": 15, "verbose": -1, "seed": 0}
bst = lgb.train(bst_params, ds, num_boost_round=10)
rmse = np.sqrt(np.mean((bst.predict(X) - y) ** 2))
bst_params.update(
{
"use_quantized_grad": True,
"num_grad_quant_bins": 30,
"quant_train_renew_leaf": True,
}
)
quant_bst = lgb.train(bst_params, ds, num_boost_round=10)
quant_rmse = np.sqrt(np.mean((quant_bst.predict(X) - y) ** 2))
assert quant_rmse < rmse + 6.0

I don't think we should do anything right now. Just posting this issue to count future failures similarly how we do in #4074.

cc @shiyu1994 @jameslamb

@StrikerRUS StrikerRUS added the bug label Oct 29, 2024
@shiyu1994 shiyu1994 self-assigned this Dec 6, 2024
@shiyu1994
Copy link
Collaborator

This is perhaps due to the nondeterministic result among different environments. I'll look into this and provide a more deterministic check for this test case.

@StrikerRUS
Copy link
Collaborator Author

The second failure just happened: https://github.com/microsoft/LightGBM/actions/runs/12387337319/job/34576641552?pr=6761#step:5:7146

>       assert quant_rmse < rmse + 6.0
E       assert np.float64(2988.108396382464) < (np.float64(24.313125588236623) + 6.0)

Interestingly, that numbers are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants