Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kronfluence

> 编程语言
Open source

Influence Functions with (Eigenvalue-corrected) Kronecker-Factored Approximate Curvature

198 stars0 likes2 views
WebsiteGitHub

About

Influence Functions with (Eigenvalue-corrected) Kronecker-Factored Approximate Curvature


Kronfluence is a PyTorch package designed to compute influence functions using Kronecker-factored Approximate Curvature (KFAC) or Eigenvalue-corrected KFAC (EKFAC). For detailed description of the methodology, see the paper, Studying Large Language Model Generalization with Influence Functions.


Installation

[!IMPORTANT] Requirements:

  • Python: Version 3.9 or later
  • PyTorch: Version 2.1 or later

To install the latest stable version, use the following pip command:

bash
pip install kronfluence

Alternatively, you can install directly from source:

bash
git clone https://github.com/pomonam/kronfluence.git
cd kronfluence
pip install -e .

Getting Started

Kronfluence supports influence computations on nn.Linear and nn.Conv2d modules. See the Technical Documentation page for a comprehensive guide.

TL;DR You need to prepare a trained model and datasets, and pass them into the Analyzer class.

…

Kronfluence supports various PyTorch features; the following table summarizes the supported features:

The examples folder contains several examples demonstrating how to use Kronfluence.

LogIX

While Kronfluence supports influence function computations on large-scale models like Meta-Llama-3-8B-Instruct, for those interested in running influence analysis on even larger models or with a large number of query data points, our project LogIX may be worth exploring. It integrates with frameworks like HuggingFace Trainer and PyTorch Lightning and is also compatible with many PyTorch features (DDP & FSDP & DeepSpeed).

Contributing

Contributions are welcome! To get started, please review our Code of Conduct. For bug fixes, please submit a pull request. If you would like to propose new features or extensions, we kindly request that you open an issue first to discuss your ideas.

Setting Up Development Environment

To contribute to Kronfluence, you will need to set up a development environment on your machine. This setup includes installing all the dependencies required for linting and testing.

bash
git clone https://github.com/pomonam/kronfluence.git
cd kronfluence
pip install -e ."[dev]"

Style Testing

To maintain code quality and consistency, we run ruff and linting tests on pull requests. Before submitting a pull request, please ensure that your code adheres to our formatting and linting guidelines. The following commands will modify your code. It is recommended to create a Git commit before running them to easily revert any unintended changes.

Sort import orderings using isort:

bash
isort kronfluence

Format code using ruff:

bash
ruff format kronfluence

To view all pylint complaints, run the following command:

bash
pylint kronfluence

Please address any reported issues before submitting your PR.

Acknowledgements

Omkar Dige contributed to the profiling, DDP, and FSDP utilities, and Adil Asif provided valuable insights and suggestions on structuring the DDP and FSDP implementations. I also thank Hwijeen Ahn, Sang Keun Choe, Youngseog Chung, Minsoo Kang, Sophie Liao, Lev McKinney, Laura Ruis, Andrew Wang, and Kewen Zhao for their feedback.

License

This software is released under the Apache 2.0 License, as detailed in the LICENSE file.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoninfluence-functionspytorch

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言