Proof of the generalized equipartition theorem The generalized equipartition theorem (where variables need not be quadratic) states that if $x_i$ is a canonical variable (position or momentum variable), then
$$\left\langle x_i \frac{\partial \mathcal{H}}{\partial x_j}\right\rangle = \delta_{ij}\ k T$$
where the average $\langle \cdot \rangle$ is taken over an equilibrium probability density $\rho(p,q)$:
$$\langle f(p,q) \rangle = \int dp dq \ \rho(p,q) \ f(p,q)$$
In the most general case this probability density is the canonical ensemble's. For the theorem to hold ergodicity is also required. However, I'm having trouble finding a rigorous prove where the assumptions are explicitly used in the derivation. 
Could you provide such a prove, or a reference to a paper/book where it can be found?
 A: The generalized equipartition theorem is derived in Section 6.4 of the famous Huang's Statistical Mechanics book (1987, 2nd edition).
In order to prove the "generalized equipartition theorem", Huang uses the microcanonical ensemble, which is the "standard" choice for systems that can be regarded as isolated (in the sense that the energy is a constant of the motion). This "standard" choice of the microcanonical is somehow justified if we believe that the system is ergodic, or if we assume the ergodic hypothesis. In other words, to prove equipartition, ergodicity may only be needed as a very first step to justify the use of the microcanonical ensemble in the first place, see e.g. this, this and this answers. Is ergodicity necessary?
Let me stress that Huang does not invoke the ergodic theorem to justify the microcanonical ensemble, even though it seems to be the justification we need: this is discussed in Section 4.5 of the same book. In fact, another way to look at the microcanonical ensemble is the principle of indifference, as proposed by Jaynes in "Information and Statistical Mechanics", see also this and this answers. Jaynes' argument provides a justification for the use of the microcanonical ensemble (not its "realism") that is alternative (or complementary) to the ergodic hypothesis.
In other words: if our isolated system is ergodic, then the microcanonical ensemble can (in principle) be realized, see e.g. the historical review by Gallavotti. If we are not sure about the ergodicity of the system, we can still use the microcanonical ensemble via Jaynes' argument, even though it may not be physically realized. There seems to be no other connection between the equipartition theorem and ergodicity other than this, quite indirect, link. I may be wrong, but it seems to me that there is the same (indirect) connection between "ergodicity" and any possible result pertaining to the equilibrium state, see e.g. this answer.
A: J. A. S. Lima and A. R. Plastino published the article On the classical energy equipartition theorem back in 1999. In their article they derive a generalized equipartition theorem. Their generalized approach is valid for systems with arbitrary distribution functions and for systems with non-quadratic terms in the Hamiltionian. A link to their article is https://doi.org/10.1590/S0103-97332000000100019. This article should answer most of your questions.
Their article can be summarized as follows:
Suppose there is a system with $f$ degrees of freedom and the Hamiltonian is
\begin{equation}
\mathcal{H} = g(x_1,...,x_L) + h.
\end{equation}
$(x_1,...,x_L)$ is a subset of the phase-space coordinates for positions and momentas. $g$ is homogeneous such that
\begin{equation}
g\left(\lambda x_{1}, \ldots, \lambda x_{L}\right)=\lambda^{r} g\left(x_{1}, \ldots, x_{L}\right).
\end{equation}
For systems that are distributed according to a Boltzmann distribution you can derive the expression
\begin{equation}
\langle g\rangle=\frac{L}{r} k_B T.
\end{equation}
Here $k_B$ is the Boltzmann constant and $T$ is the temperature. This is the generalized form of the equipartition theorem that you are looking for. For example, for a monovalent ideal gas you have $r=2$ and $L=3N$ such that you recover the famous result $U = \frac{3}{2}N k_B T$ where U is the internal energy of the gas.
