We study the large N 't Hooft expansion of the chiral partition function of 2d U (N ) Yang-Mills theory on a torus. There is a long-standing puzzle that no explicit holomorphic anomaly equation is known for the partition function, although it admits a topological string interpretation. Based on the chiral boson interpretation we clarify how holomorphic anomaly arises and propose a natural anti-holomorphic deformation of the partition function. Our deformed partition function obeys a fairly traditional holomorphic anomaly equation. Moreover, we find a closed analytic expression for the deformed partition function. We also study the behavior of the deformed partition function both in the strong coupling/large area limit and in the weak coupling/small area limit. In particular, we observe that drastic simplification occurs in the weak coupling/small area limit, giving another nontrivial support for our anti-holomorphic deformation.