CoolFace
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 2d agoView on Hugging Face
0likes1.1kdownloads
debug.h32 linesDownload Raw Back to common
1#pragma once2 3#include <memory>4#include <string>5#include <vector>6 7// common debug functions and structs8 9struct common_params;10 11// Intended to use as callback for ggml_backend_sched_eval_callback12// prints tensors that are processed in the computation graph13// by default prints all tensors, but can be configured by creating a `common_debug_cb_user_data` instance with14// non-empty filter_patterns. See examples/debug.cpp for possible usage patterns15// `common_debug_cb_user_data` contains `abort_on_nan` flag that determines whether an error should be thrown whenever a NaN is encountered16// in a tensor (useful for stopping debug sessions on first erroneous tensor)17// The callback data will be passed as the third parameter (user_data)18bool common_debug_cb_eval(struct ggml_tensor * t, bool ask, void * user_data);19 20struct common_debug_cb_user_data {21    struct impl;22    std::unique_ptr<impl> pimpl;23 24    common_debug_cb_user_data();25    ~common_debug_cb_user_data();26 27    common_debug_cb_user_data(const common_debug_cb_user_data &) = delete;28    common_debug_cb_user_data & operator=(const common_debug_cb_user_data &) = delete;29 30    common_debug_cb_user_data(common_params & params, const std::vector<std::string> & filter_patterns, bool abort_on_nan = false);31};32