Title: compute_pareto_efficiency crashes with "F" returns in multi-objective CBO · Issue #366 · deephyper/deephyper · GitHub
Open Graph Title: compute_pareto_efficiency crashes with "F" returns in multi-objective CBO · Issue #366 · deephyper/deephyper
X Title: compute_pareto_efficiency crashes with "F" returns in multi-objective CBO · Issue #366 · deephyper/deephyper
Description: Summary When a run function returns "F" (the documented failure convention) in multi-objective CBO, compute_pareto_efficiency() crashes with ValueError: array must not contain infs or NaNs. The failure filter only checks the first object...
Open Graph Description: Summary When a run function returns "F" (the documented failure convention) in multi-objective CBO, compute_pareto_efficiency() crashes with ValueError: array must not contain infs or NaNs. The fai...
X Description: Summary When a run function returns "F" (the documented failure convention) in multi-objective CBO, compute_pareto_efficiency() crashes with ValueError: array must not contain infs or NaN...
Opengraph URL: https://github.com/deephyper/deephyper/issues/366
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"compute_pareto_efficiency crashes with \"F\" returns in multi-objective CBO","articleBody":"## Summary\n\nWhen a run function returns `\"F\"` (the documented failure convention) in multi-objective CBO, `compute_pareto_efficiency()` crashes with `ValueError: array must not contain infs or NaNs`. The failure filter only checks the first objective column, so `\"F\"` values in other columns slip through as NaN.\n\n## Reproducer\n\n```python\nfrom deephyper.evaluator import Evaluator, RunningJob\nfrom deephyper.hpo import CBO, HpProblem\n\nproblem = HpProblem()\nproblem.add_hyperparameter((0.0, 1.0), \"x\")\n\ndef run(job: RunningJob):\n x = job.parameters[\"x\"]\n if x \u003c 0.5:\n return \"F\" # fail half the configs\n return {\"objective\": (x, -x)}\n\nevaluator = Evaluator.create(run, method=\"thread\")\nsearch = CBO(problem, surrogate_model=\"ET\", acq_func=\"UCB\",\n moo_scalarization_strategy=\"Chebyshev\")\nresults = search.search(evaluator, max_evals=10) # crashes\n```\n\n## Traceback\n\n```\nFile \"deephyper/hpo/_search.py\", line 234, in compute_pareto_efficiency\n mask_pareto_front = non_dominated_set(objectives)\nFile \"deephyper/skopt/moo/_pf.py\", line 103, in non_dominated_set\n y = np.asarray_chkfinite(y)\nValueError: array must not contain infs or NaNs\n```\n\n## Root Cause\n\nIn `_search.py:232`, `compute_pareto_efficiency` calls:\n\n```python\n_, mask_no_failures = get_mask_of_rows_without_failures(df, objective_columns[0])\n```\n\nThis only checks `objective_columns[0]` for `\"F\"` strings. In multi-objective mode, when `\"F\"` is returned, DeepHyper stores the failure marker in each objective column. However, pandas may infer mixed dtypes per column — if `objective_0` happens to be numeric (e.g., when some evals succeed), `get_mask_of_rows_without_failures` takes the `else` branch (`isinstance(x, float)`) and correctly filters failures. But if `objective_1` or `objective_2` columns contain `\"F\"` strings that weren't checked, the subsequent `.astype(float)` on line 233 silently converts them to NaN:\n\n```python\nobjectives = -df.loc[mask_no_failures, objective_columns].values.astype(float)\n```\n\nThen `non_dominated_set()` calls `np.asarray_chkfinite(y)`, which rejects NaN.\n\nThe issue is that `get_mask_of_rows_without_failures` is called on **only the first objective column**, not all of them.\n\n## Suggested Fix\n\nCheck all objective columns and combine the masks:\n\n```python\n# _search.py, compute_pareto_efficiency(), around line 232\n# Before (buggy):\n_, mask_no_failures = get_mask_of_rows_without_failures(df, objective_columns[0])\n\n# After (fixed):\nmask_no_failures = np.ones(len(df), dtype=bool)\nfor col in objective_columns:\n _, col_mask = get_mask_of_rows_without_failures(df, col)\n mask_no_failures &= col_mask\n```\n\n## Environment\n\n- DeepHyper 0.13.2 (latest on PyPI)\n- Python 3.11\n- Multi-objective CBO with Chebyshev scalarization\n\n## Workaround\n\nReturn a numeric penalty tuple instead of `\"F\"`:\n\n```python\nreturn {\"objective\": (-1.0, -1.0, -1.0)} # instead of return \"F\"\n```","author":{"url":"https://github.com/pbalapra","@type":"Person","name":"pbalapra"},"datePublished":"2026-04-03T20:39:59Z","url":"https://github.com/deephyper/deephyper/issues/366"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8ff4368b-1e19-c847-f7a4-b17baa389c1d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A19A:2FFC62:FCE477:160F285:6B0446A7 |
| html-safe-nonce | 661c87f14ee2fb6096e81682210f5b5e072d1975eacf40933563a8602536079c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTlBOjJGRkM2MjpGQ0U0Nzc6MTYwRjI4NTo2QjA0NDZBNyIsInZpc2l0b3JfaWQiOiI4MTU0Njk2NjI2NzkyMDU2NDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ca1c000d56676cbbf2a998d3fc2dc26bce5a06537514f30126adab483b1cf031 |
| hovercard-subject-tag | issue:4202124686 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/deephyper/deephyper/366/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4f97ebf4a7c83250c52ceb2b7fe9f4a4d6771559aa132a731b65b3300e5c9101/deephyper/deephyper/issues/366 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4f97ebf4a7c83250c52ceb2b7fe9f4a4d6771559aa132a731b65b3300e5c9101/deephyper/deephyper/issues/366 |
| og:image:alt | Summary When a run function returns "F" (the documented failure convention) in multi-objective CBO, compute_pareto_efficiency() crashes with ValueError: array must not contain infs or NaNs. The fai... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pbalapra |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| turbo-cache-control | no-preview |
| go-import | github.com/deephyper/deephyper git https://github.com/deephyper/deephyper.git |
| octolytics-dimension-user_id | 44810957 |
| octolytics-dimension-user_login | deephyper |
| octolytics-dimension-repository_id | 156403341 |
| octolytics-dimension-repository_nwo | deephyper/deephyper |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 156403341 |
| octolytics-dimension-repository_network_root_nwo | deephyper/deephyper |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width