Skill / SKILL.md

Pyfixest Grid Sharding

kennethkhoocy/applied-micro-skills

Diagnose and fix slow pyfixest regression GRIDS (many feols/fepois calls run sequentially) that stay slow despite demeaner_backend="cupy64" and an idle GPU. Use when: (1) a script looping dozens of pf.feols models on a 100k+ row panel takes ~1 min/model, (2) process inspection shows ~1-1.5 cores busy and nvidia-smi shows ~0% GPU utilization with a resident cupy context, (3) planning any worker prompt that will run a model grid (robustness variants x FE structures x domains). Root cause: per-model CPU-side single-threaded fixed costs (formulaic model-matrix build, interaction construction, singleton detection, cluster vcov) dominate wall time; GPU demeaning is a small slice. Fix: shard the model grid across OS processes and/or use pyfixest multiple-estimation syntax; mandate this IN THE WORKER PROMPT.
2 views 18 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Diagnose and fix slow pyfixest regression GRIDS (many feols/fepois calls run sequentially) that stay slow despite demeaner_backend="cupy64" and an idle GPU. Use when: (1) a script looping dozens of pf.feols models on a 100k+ row panel takes ~1 min/model, (2) process inspection shows ~1-1.5 cores busy and nvidia-smi shows ~0% GPU utilization with a resident cupy context, (3) planning any worker prompt that will run a model grid (robustness variants x FE structures x domains). Root cause: per-model CPU-side single-threaded fixed costs (formulaic model-matrix build, interaction construction, singleton detection, cluster vcov) dominate wall time; GPU demeaning is a small slice. Fix: shard the model grid across OS processes and/or use pyfixest multiple-estimation syntax; mandate this IN THE WORKER PROMPT.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/kennethkhoocy/applied-micro-skills' skill-source

Use the complete skill-source/plugins/applied-micro/skills/pyfixest-grid-sharding directory with your client’s skill installer.

  • plugins/applied-micro/skills/pyfixest-grid-sharding

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory plugins/applied-micro/skills/pyfixest-grid-sharding

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
22d73253b0acab72fc7b1e5b559a5bd1c9e064f77d9ec8ea01b505faeaa28d7f
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills