Skip to main content

A new package that takes a user's text input about floating-point arithmetic or SIMD programming challenges and returns a structured analysis of potential associativity issues. It uses an LLM to gener

Project description

fp-associativity-analyzer

PyPI version License: MIT Downloads LinkedIn

The fp_associativity_analyzer package is a tool designed to help developers and researchers analyze their text inputs regarding floating-point arithmetic or SIMD programming challenges and identify potential issues related to associativity. Utilizing advanced language models, it provides a structured analysis that extracts key points and insights, ensuring consistent formatting and reliable outputs. This aids in understanding scenarios where floating-point non-associativity could lead to unexpected results, especially in high-performance computing contexts.

Installation

pip install fp_associativity_analyzer

Usage

Here's an example of how to use the package in Python:

from fp_associativiity_analyzer import fp_associativity_analyzer

response = fp_associativity_analyzer(
    user_input="Explain the potential associativity issues in SIMD loop optimizations.",
    api_key="your_api_key_here"  # Optional if you want to provide your own API key
)
print(response)

Parameters

  • user_input (str): The text describing the floating-point or SIMD challenge to analyze.
  • llm (Optional[BaseChatModel]): An instance of a language model. Defaults to the internal ChatLLM7.
  • api_key (Optional[str]): Your API key for LLM7. If not provided, will be obtained from the environment variable LLM7_API_KEY.

LLM Compatibility

This package uses ChatLLM7 from langchain_llm7 by default. You can safely pass your own language model instance for customization, such as:

  • OpenAI GPT models
  • Anthropic Claude
  • Google PaLM

Examples

Using OpenAI:

from langchain_openai import ChatOpenAI
from fp_associativiity_analyzer import fp_associativity_analyzer

llm = ChatOpenAI()
response = fp_associativity_analyzer(
    user_input="Describe non-associative floating-point operations.",
    llm=llm
)
print(response)

Using Anthropic:

from langchain_anthropic import ChatAnthropic
from fp_associativiity_analyzer import fp_associativity_analyzer

llm = ChatAnthropic()
response = fp_associativity_analyzer(
    user_input="How does floating-point non-associativity affect parallel computations?",
    llm=llm
)
print(response)

Using Google PaLM:

from langchain_google_genai import ChatGoogleGenerativeAI
from fp_associativiity_analyzer import fp_associativity_analyzer

llm = ChatGoogleGenerativeAI()
response = fp_associativity_analyzer(
    user_input="What are the implications of floating-point non-associativity?",
    llm=llm
)
print(response)

Rate Limits

The default usage of LLM7 in this package is configured for the free tier, which provides sufficient rate limits for most use cases. For higher rate limits, you can obtain a free API key from LLM7 Token Service and supply it via the environment variable LLM7_API_KEY or directly in the function call.

Support & Issues

For issues, bug reports, or feature requests, please visit the GitHub repository:

https://github.com/chigwell/fp-associativity-analyzer

Author

Eugene Evstafev
Email: hi@euegne.plus
GitHub: @chigwell

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fp_associativity_analyzer-2025.12.21134137.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file fp_associativity_analyzer-2025.12.21134137.tar.gz.

File metadata

File hashes

Hashes for fp_associativity_analyzer-2025.12.21134137.tar.gz
Algorithm Hash digest
SHA256 e1999bd3c88e1cba8f3ed689cb8343b8ba179ff5468bb607f7deb77a6ea19c3e
MD5 73211ac3d2d218b977986b8e67b9d3c9
BLAKE2b-256 5700fe889e8dc10a8cd875d11261ce67b939fbe71b453c4d2c23dc0c43a3204e

See more details on using hashes here.

File details

Details for the file fp_associativity_analyzer-2025.12.21134137-py3-none-any.whl.

File metadata

File hashes

Hashes for fp_associativity_analyzer-2025.12.21134137-py3-none-any.whl
Algorithm Hash digest
SHA256 c034d41718e2ae150a9c847644e84dbe7db29f7cd49811ca7c990c0e6bef014b
MD5 d9db1eb2924b6e5703bfd9d19dac6d98
BLAKE2b-256 557e45e001739ccb20efe7383884da1a3b7fa906843b925679ad49044f5add59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page