opencog_ml: proper sampling, double-free fix, warning cleanup, CI inference coverage - #2
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/org-echo-opencog/ocrwkv.cpp/sessions/0c0bb6e8-3aad-405b-86aa-88e3b5261e7f Co-authored-by: drzo <15202748+drzo@users.noreply.github.com>
…rence tests Agent-Logs-Url: https://github.com/org-echo-opencog/ocrwkv.cpp/sessions/0c0bb6e8-3aad-405b-86aa-88e3b5261e7f Co-authored-by: drzo <15202748+drzo@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
sample_tokenwas greedy-only (temperature/top-k/top-p parameters silently ignored), two inference functions had a double-free in their error paths, andopencog_ml_testsran without a model so all inference tests were skipped in CI.Sampling (
opencog_ml.cpp)Replaced stub greedy implementation with full pipeline:
1/temperature, renormalizeGreedy path preserved when
temperature <= 0.Double-free fix (
opencog_ml.cpp)In both
opencog_ml_infer_tokenandopencog_ml_infer_sequence,owns_data = truewas set on the tensor views before the NULL check. If eithercreate_tensor_viewcall failed, the error path called bothfree(buffer)andopencog_ml_free_tensor()on the same pointer. Fixed by movingowns_data = trueto after the check, keeping raw-buffer frees only in the error branch.Compiler warnings (
test_opencog_ml.c,opencog_ml_example.c)voidto C function prototypes (-Wstrict-prototypes)has_valid_dataset-but-not-used variablefloat → doubleinprintfcalls (-Wdouble-promotion)CI inference coverage (
CMakeLists.txt)Passed
tiny-rwkv-4v0-660K-FP32.bintoopencog_ml_testsso engine-management, state-management, and basic-inference test cases actually execute in CI instead of printingSKIP.